• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
"-exec ..." in NSTask ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"-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.

  • Follow-Ups:
    • Re: "-exec ..." in NSTask ?
      • From: Mark Dalrymple <email@hidden>
  • Prev by Date: Re: Can't get NSToolbar to work
  • Next by Date: RE: "-exec ..." in NSTask ?
  • Previous by thread: RE: Dictionary or Array?
  • Next by thread: Re: "-exec ..." in NSTask ?
  • Index(es):
    • Date
    • Thread