<div dir="ltr">Thank you all so much for the great answers :)<div><br></div><div style>Since I posed the question I have been working out a solution. In the attached file I first send a message to [shell] to tell me how many files are in the folder. Then, since all the files are named &quot;1.wav&quot;, &quot;2.wav&quot;, etc., I run those numbers through a [list-drip] and tell [shell] to delete them one at a time. It ALMOST works I think, but it has an error that says &quot;shell: old process still running&quot;... Maybe [list-drip]&#39;s consecutive messages are too fast? Maybe there is no time between the  first kind of [shell] command and the second?</div>
<div style><br></div><div style>Also, I&#39;m a Macbook Pro (4 GB ram) user running 10.7.5 Lion.</div><div style><br></div><div style>I&#39;d appreciate any help with my code. Like I said, I think I&#39;m almost there, maybe my code needs a little tweaking.</div>
<div style><br></div><div style>Thank you,</div><div style>Sebastian</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jan 28, 2013 at 7:24 AM, Lorenzo Sutton <span dir="ltr">&lt;<a href="mailto:lorenzofsutton@gmail.com" target="_blank">lorenzofsutton@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi.<br>
<br>
Just a small addition to the various answers<div class="im"><br>
<br>
On 27/01/13 22:25, Sebastian Valenzuela wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi list,<br>
<br>
My Pd patch creates and saves new audio files to a designated folder on my desktop. I would like to have Pd delete these files every time I open my patch ([loadbang]).<br>
<br>
I&#39;ve heard the [shell] object is a possibility, but i&#39;m not too keen on terminal commands or how they will pertain to [shell]...<br>
</blockquote></div>
It would be helpful if you specified on with Operating System you are, because [shell] is heavily OS dependent (I&#39;m guessing Windows, but I may be wrong)<div class="im"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Can anyone please give me an example of a command I would send to [shell] to delete all files within a specified folder on my desktop? If this isn&#39;t the best way to do it, is there another possibility through Pd?<br>

</blockquote></div>
A different strategy might also be to actually *not* delete files from within Pd, but outside, befor or after you close your patch. This is easily accoplished e.g. by a script.<br>
<br>
Also a suggestion would be to give the temporary files very eloquent names such as &#39;TEMP_FILE_TO_DELETE_0001.wav&#39; etc. and (whichever way you decide to do it) delete specifically *those* files instead of e.g. the whole directory, so e.g. instead of:<br>

<br>
rm -f ./dir_to_delete/*<br>
<br>
something like<br>
<br>
rm -f ./dir_to_delete/TEMP_FILE_TO_<u></u>DELETE_*.wav&#39;<br>
<br>
In my humble opinion it makes it more obvious what you want to delete, and (hopefully) less error/disaster prone (ok.. I&#39;ve been bit by accidentally deleting files with no back up)<span class="HOEnZb"><font color="#888888"><br>

<br>
Lorenzo.<br>
</font></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
<br>
Thank you for your time,<br>
Sebastian<br>
<br>
<br>
<br></div><div class="im">
______________________________<u></u>_________________<br>
<a href="mailto:Pd-list@iem.at" target="_blank">Pd-list@iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -&gt; <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/<u></u>listinfo/pd-list</a><br>
</div></blockquote><div class="HOEnZb"><div class="h5">
<br>
<br>
______________________________<u></u>_________________<br>
<a href="mailto:Pd-list@iem.at" target="_blank">Pd-list@iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -&gt; <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/<u></u>listinfo/pd-list</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px">Sebastian Ignacio Valenzuela Rojas<font size="1" color="#666666"><br>
</font></span><div><div><div><font face="arial, sans-serif"><span style="border-collapse:collapse">Composer - Performer</span></font></div><div><font face="arial, sans-serif" size="1"><span style="border-collapse:collapse"><a href="http://svalenzuelamusic.wix.com/home" target="_blank">svalenzuelamusic.wix.com/home</a></span></font></div>
<div><font face="arial, sans-serif" size="1"><span style="border-collapse:collapse"><a href="http://www.youtube.com/svalenzuelamusic" target="_blank">youtube.com/svalenzuelamusic</a></span></font></div></div></div>
</div>