Re: Executing A Shell Script...
Re: Executing A Shell Script...
- Subject: Re: Executing A Shell Script...
- From: Ondra Cada <email@hidden>
- Date: Fri, 30 Aug 2002 19:01:54 +0200
On Friday, August 30, 2002, at 03:50 , Albert Atkinson wrote:
Thanks for your assistance! I have one more question about this...how
would I display the result of the script in an NSTextView? Like if I
typed "ls /MY/PATH" in the Terminal, it would print out all the contents
of the path. How would I take what it prints out and display it in my
NSTextView? Would it just be something like:
[NSTextView setText: system("ls My/Path")];
Don't use system; use NSTask. See its standard output option, NSPipe, and
NSFileHandle.
If you for any reason wanna stick with the BSD API, "man popen", but
NSTask's infinitely better and more convenient.
I was wondering if there was any way to execute a shell script from
Cocoa? I know in AppleScript you can do:
do shell script ("cd PATH/TO/FOLDER")
Since "cd" is a shell builtin, I really doubt this might work in any
reasonable way.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
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.