RE: "-exec ..." in NSTask ?
RE: "-exec ..." in NSTask ?
- Subject: RE: "-exec ..." in NSTask ?
- From: "Stefan Johansson" <email@hidden>
- Date: Fri, 13 Jun 2003 16:03:10 +0200
- Thread-topic: "-exec ..." in NSTask ?
Hello,
maybe I'm completely wrong here, but shouldn't the exec part of the command line be treated as one single parameter?
I.e either
@"-exec rm -f {} \\;"
or
@"-exec"
@"rm -f {} \\;"
I'm not sure, but I think it's treated as one (at least from find's point of view) when running on the command line.
I tend to lean towards the second one above.
Cheers,
Stefan
>
-----Original Message-----
>
From: Zeno Crivelli [mailto:email@hidden]
>
Sent: den 13 juni 2003 15:46
>
To: email@hidden
>
Subject: "-exec ..." in NSTask ?
>
>
>
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.
_______________________________________________
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.