Re: NSTask Permission denied
Re: NSTask Permission denied
- Subject: Re: NSTask Permission denied
- From: Sherm Pendley <email@hidden>
- Date: Sat, 20 Nov 2004 05:41:41 -0500
On Nov 19, 2004, at 6:06 PM, John C. Randolph wrote:
On Jul 21, 2004, at 8:11 PM, Jim Ways wrote:
I get the following dump when i attempt to use [NSTask
launch]. I want to launch a UEF under libary but i
cant even seem to lauch anything in applications.
runtime = [[NSTask alloc] init];
[runtime setLaunchPath:
@"/Applications/TextEdit.app"];
[runtime launch];
*** NSTask: Task create for path
/Applications/TextEdit.app failed: 13, "Permission
denied".
Any ideas? Thanks Guys!
Do you actually need to launch TextEdit as a sub-process, or would
NSWorkspace's -launchApplication: API suffice?
-jcr
John's question is spot-on - if NSWorkspace will work for you, it's
probably better to use it.
But, if you really want to launch a child process for some reason, the
problem with the code above is that it's trying to execute a directory.
You need to specify the path to the binary inside the .app bundle if
you want to run it.
Alternatively, you could run /usr/bin/open with NSTask, and pass it two
arguments: "-a", "TextEdit". That's probably a better choice, as it
doesn't rely on the directory layout within the .app bundle.
sherm--
_______________________________________________
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