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] | [shell]
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...)
Best, Derek
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?
The purpose is to add the "rm" command to the filename created previously. I don't see your logic with the message, however. Are you trying to avoid using [prepend] (i.e. to stay Vanilla)?
D.
IOhannes m zmoelnig wrote:
On 2010-02-23 13:16, Derek Holzer wrote:
| [prepend rm]
what is the purpose of [prepend] here? couldn't you do that with [prepend $1( for exactly the same effect?
fgmkasdr IOhannes
| [shell]
On Wed, 2010-02-24 at 09:35 +0100, Derek Holzer wrote:
The purpose is to add the "rm" command to the filename created previously. I don't see your logic with the message, however. Are you trying to avoid using [prepend] (i.e. to stay Vanilla)?
D.
IOhannes m zmoelnig wrote:
On 2010-02-23 13:16, Derek Holzer wrote:
| [prepend rm]
what is the purpose of [prepend] here? couldn't you do that with [prepend $1( for exactly the same effect?
I guess, [rm $1( was meant here.
Roman
___________________________________________________________ Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de
Ah, OK. It was a quickly made patch, I just used the first objects which came to mind.
I didn't know about [sys_gui] before. Interesting...
D.
Roman Haefeli wrote:
On Wed, 2010-02-24 at 09:35 +0100, Derek Holzer wrote:
The purpose is to add the "rm" command to the filename created previously. I don't see your logic with the message, however. Are you trying to avoid using [prepend] (i.e. to stay Vanilla)?
D.
IOhannes m zmoelnig wrote:
On 2010-02-23 13:16, Derek Holzer wrote:
| [prepend rm]
what is the purpose of [prepend] here? couldn't you do that with [prepend $1( for exactly the same effect?
I guess, [rm $1( was meant here.
On 2010-02-24 09:35, Derek Holzer wrote:
The purpose is to add the "rm" command to the filename created previously. I don't see your logic with the message, however. Are you trying to avoid using [prepend] (i.e. to stay Vanilla)?
yes, i made a typo. it should have read [rm $1(
and yes, the question is, why you would want to use [prepend] (e.g. an external object), for something that has always been possible to do with vanilla pd.
fgmsdr IOhannes