Re: "-exec ..." in NSTask ?
Re: "-exec ..." in NSTask ?
- Subject: Re: "-exec ..." in NSTask ?
- From: Mark Dalrymple <email@hidden>
- Date: Fri, 13 Jun 2003 10:19:35 -0400
Hi Zeno,
> (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)
For complex commands like that, particularly ones with high overhead
(like find groveling through the file system), I use NSTask to start a
shell, and feed the shell the command to run with the -c flag. It
makes the arguments array a lot simpler and easier to maintain:
NSArray *arguments = [NSArray arrayWithObjects: @"-c", @"find . -name
*.java -exec ...'", nil];
rather than a dozen strings for each small chunk.
Here's something from the archives
http://cocoa.mamasam.com/COCOADEV/2003/04/2/61767.php
and I have a simple project that uses this that I can send to you if
you want.
Cheers,
++Mark Dalrymple, email@hidden
http://borkware.com
_______________________________________________
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.