NSTask: script not int the executable path
NSTask: script not int the executable path
- Subject: NSTask: script not int the executable path
- From: Jérôme Paschoud <email@hidden>
- Date: Fri, 8 Jul 2005 18:11:10 +0200
Hi everyone,
I'm using a perl script wrapped in the bundle of my application. This
application can be copied everywhere. When launching the script via
the terminal you should write:"./script.pl" in order to run it. The
code I wrote to launch the script in an NSTask is the fellowing:
// create the path of the deamon script
NSString *path = [[[[NSBundle mainBundle] bundlePath]
stringByAppendingPathComponent:@"Contents/Resources/diogenes-1.4.3/
Deamon.pl"] stringByStandardizingPath];
// run the daemon
NSTask *daemon = [[NSTask alloc] init];
[daemon setLaunchPath: path];
//NSLog([daemon launchPath]);
[daemon launch];
Of course when running the app I get an exception. I suspect that
NSTask try to launch the script like that: "script.pl" and that does
not work because the directory of the script is not in the PATH
environment variable.
Could someone help me by explaining how to luanch a script via NSTask
without having it in the PATH.
CU Jerome
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden