[PD] how to check, if file is existing or not

cr ix at replic.net
Fri Jun 18 19:26:43 CEST 2004


On Fri, Jun 18, 2004 at 06:17:45PM +0200, Roman Haefeli wrote:
> hi
> 
> i'm looking for a way to check, if a file at a certain place exists or not.
> i tried to [read( a non-existing file with [textfile], but the error
> ('path/nonexisting_file.pd can't open') is only displayed in the terminal.
> there is no feedback in pd itself.
> any suggestions, how to do that?

i use bash for this., via the shell external (linux version in CVS, windows version at http://whats-your.name/pd/extra/shell/ ) - sent a message like:

bash -c 'test -e "`echo $1`" && echo yep|| echo nop

followed by a 'select' object to determine which course of events to take...

the only reason you have to backtick the "echo $1" instead of just doing a test -e "$1" is due to pd not otherwise substituting the $1 with an actual live value...im not sure if thats a bug or a feature, but the above works for me....

cr




More information about the Pd-list mailing list