Re: NSTask Permission denied
Re: NSTask Permission denied
- Subject: Re: NSTask Permission denied
- From: Shawn Erickson <email@hidden>
- Date: Wed, 21 Jul 2004 20:45:42 -0700
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!
/Applications/TextEdit.app isn't an application it is directory. Native
applications on Mac OS X are really directories with a well defined
internal file layout [1]. You likely want to hit the executable
directly ... /Applications/TextEdit.app/Contents/MacOS/TextEdit.
With that said it would better to use NSWorkspace's launchApplication
[2] method to launch applications. It is more future proof since it
will insure the correct binary gets called (an application can have
multiple binaries for differing architectures in its bundle).
-Shawn
[1]
<
http://developer.apple.com/documentation/CoreFoundation/Conceptual/
CFBundles/index.html>
[2]
<
http://developer.apple.com/documentation/Cocoa/Reference/
ApplicationKit/ObjC_classic/Classes/NSWorkspace.html#//apple_ref/doc/
uid/20000391/launchApplication_>
_______________________________________________
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.