• 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
NSTask: script not int the executable path
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSTask: script not int the executable path
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Power Manager in Tiger
  • Next by Date: Re: can't make an NSButton small enough
  • Previous by thread: Power Manager in Tiger
  • Next by thread: Re: NSTask: script not int the executable path
  • Index(es):
    • Date
    • Thread