Re: Executing A Shell Script...
Re: Executing A Shell Script...
- Subject: Re: Executing A Shell Script...
- From: Jeffrey J Barbose <email@hidden>
- Date: Fri, 30 Aug 2002 14:44:12 -0700
NSTask will notify you when the thread it's in is going away.
When you get that notification, ask for the dictionary .
In that dictionary, you will get your results, likely as an NSString or
NSData object.
On Friday, Aug 30, 2002, at 07:21 US/Pacific, Albert Atkinson wrote:
With NSTask you would do something like:
[myTask setLaunchPath:@"/bin/tcsh"];
[arguments addObject: @"mkdir /DirMade"];
[myTask setArguments:arguments];
[myTask launch];
Correct?
Also, how would I get the output from this as said in my previous
message?
Thanks!
Albert
On Friday, August 30, 2002, at 08:53 AM, Chris Ridd wrote:
Rhon Fitzwater <email@hidden> wrote:
I think you should just be able to use: system(). So if you wanted
to
do, say mkdir, all you have to do is system("/bin/mkdir /DirMade");
I added /bin to it because you may sometime get a zsh error, which
means
it cant find the command, so I always put in the full path to be
safe.
Hope this helps.
-Rhon
You could except that using system() yourself is dangerous because of
how
the arguments are handled. Your call would break if the directory to
be
made contained a space, for example. You could also accidentally
execute
privileged code if you weren't careful about the directory name...
The safer way would surely to be create an NSTask.
Cheers,
Chris
_______________________________________________
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.
_______________________________________________
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.