[PD] deleting file from a Pd patch

Derek Holzer derek at umatic.nl
Tue Feb 23 13:16:56 CET 2010

Hi Fränk,

to do what you want, you will still need something that interfaces with 
the file system. Pd doesn't do that by itself. You would simply need to 
construct messages to [shell] which would tell it to delete the proper 
file. In your case, I would suggest [makefilename], [sprintf] or similar 
to construct the correct file names, perhaps by using a counter 
construction to increment the number of the file, then [prepend] the 
"rm" command to the created filename, then send to [shell] (untested, 
only a suggestion):

[metro 60000]
[f]X[+ 1]
[makefilename image%d.jpg]
[prepend rm]

As long as your JPGs were in the same directory as the Pd patch, 
something like this would likely do the job. Otherwise, you would have 
to include the path to the directory in the [makefilename] part (as long 
as it supports the "/" character that is...)


Fränk Zimmer wrote:
> Hi Derek,
> thanks for your reply.-
> I don´t want to do it manually.- For the project I´m working on, I store 
> capture image from a webcam to a directory.
> Every image has another name: image1.jpg, image2.jpg, image3.jpg, ...
> Now I want to delete certain images after 1min. For this I would need a 
> delete file-Function in Pd.-
> thanks.-
> fraenk
> Derek Holzer schrieb:
>> [shell] ?
>> D.
>> Fränk Zimmer wrote:
>>> Dear friends of Pd,
>>> I´m looking for a way to delete a file in a certain directory out of Pd.
>>> May be just by pressing bang. Has anybody already tried this?

::: derek holzer ::: http://macumbista.net :::
---Oblique Strategy # 58:
"Do we need holes?"

More information about the Pd-list mailing list