"-exec ..." in NSTask ?
"-exec ..." in NSTask ?
- Subject: "-exec ..." in NSTask ?
- From: Zeno Crivelli <email@hidden>
- Date: Fri, 13 Jun 2003 15:46:24 +0200
ok, basically, I would like to be able to execute the following command
<<find /Users/matt -name "*.txt" -exec rm -f {} \;>>
I know that the <<find /Users/matt -name "*.txt" -delete>> option would be
easy, but the above is only an example which I kept simple to allow easier
answers to this message...
(in reality I'll need to execute something more complex:
<<find . -name *.java -exec javac -target 1.1 -classpath
"/Applications/MIDP4OSX/classes":. \{} \;>>
but that DOESN'T MATTER: if I'm able to do the above, I'll be able to solve
my problem)
Now, I tried to put every "piece" of that command into single NSStrings:
[theTask setLaunchPath:@"/usr/bin/find"];
[theTask setArguments:[NSArray
arrayWithObjects:
@"/Users/matt",
@"-name",
@"*.txt",
@"-exec",
@"rm",
@"-f",
@"{}",
@"\\;",
nil]];
but it doesn't seem to work. Maybe because this is only allowed with "true"
parameters (like -name,...) and "exec" is actually an app itself (in
/usr/bin)...I don't know...
If you have an idea, it would be REALLY appreciated !!!
Thanks!
Zeno
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.