<div dir="ltr">Hi,<br><br>OK, your original patch was clearer. I'd prefer to go with that.<div><br></div><div>Cheers,</div><div><br></div><div>James</div></div><br><div class="gmail_quote">On Thu, 14 May 2015 at 15:34 Tzafrir Poupko <<a href="mailto:tzafrir11@gmail.com">tzafrir11@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi James,<br><br></div>As far as I can tell rmtree() does not support removing symbolic links or matching files by pattern.<br></div>Since i would like to support removal of patterns such as %t , %t.txt and %t/filename I don't see how rmtree is useful by itself<br><br></div>Attached another patch option implementing the file scanning in python instead of calling rm -rf</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 14, 2015 at 4:00 PM, James Molloy <span dir="ltr"><<a href="mailto:james@jamesmolloy.co.uk" target="_blank">james@jamesmolloy.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Tzafrir,<br><br>In which case, just using shutil.rmtree() should be sufficient: <a href="https://docs.python.org/2/library/shutil.html#shutil.rmtree" target="_blank">https://docs.python.org/2/library/shutil.html#shutil.rmtree</a><div><br></div><div>Cheers,</div><div><br></div><div>James</div></div><div><div><br><div class="gmail_quote">On Thu, 14 May 2015 at 13:57 Tzafrir Poupko <<a href="mailto:tzafrir11@gmail.com" target="_blank">tzafrir11@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>Hi James,<br><br></div>There are 2 reasons for the -f<br><br></div>1. This is what is done currently by more then 300 tests and I wouldn't like to change this.<br></div>2. Using -f suppresses error messages that will happen when no temporary file exists<br><br></div>Since there is no standard function in python to delete files and directories matching a pattern<br></div>I thought using rm -rf would be a better solution then implementing my own.<br><br></div></div><div dir="ltr">Tzafrir<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 14, 2015 at 3:27 PM, James Molloy <span dir="ltr"><<a href="mailto:james@jamesmolloy.co.uk" target="_blank">james@jamesmolloy.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Tzafrir,<br><br>This sounds like a good idea to me.<div><br></div><div><pre style="font-family:'Courier New',Courier,monospace,arial,sans-serif;font-size:14px;margin-top:0px;margin-bottom:0px;white-space:pre-wrap;word-wrap:break-word;color:rgb(0,0,0);line-height:normal">+    subprocess.call(['rm','-rf',path+"*"])
</pre></div><div><br></div><div><br></div><div>This is super dangerous. Why the -f ?</div><div><br></div><div>Cheers,</div><div><br></div><div>James</div></div><br><div class="gmail_quote"><div><div>On Thu, 14 May 2015 at 13:22 Tzafrir Poupko <<a href="mailto:tzafrir11@gmail.com" target="_blank">tzafrir11@gmail.com</a>> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">Before running a test, purge all %t files used by previous tests.<br><div class="gmail_quote"><div dir="ltr"><div>Remove any custom file used in test which was prefixed by %t.<br></div>There are over 300 clang tests that run "rm -rf %t" as first run command, this patch will make it automaticlly.<br></div>
</div><br></div></div></div>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>
</blockquote></div><br></div>
</blockquote></div>
</div></div></blockquote></div><br></div>
</blockquote></div>