On 9 Dec 2009, at 09:53, Alastair Houghton wrote:

>> 
>> Yes. ([[[NSProcessInfo processInfo] arguments] objectAtIndex:0])
> 
> No, no, no and thrice no.
> 
> What that gives you is the content of argv[0], which *is not* (necessarily) 
> the path to your program.  If you think it is, then to disabuse you of the 
> notion I can write a program like this:
> #include <unistd.h>
> 
>  int
>  main (void) {
>    execl ("/Applications/YourApp.app/Contents/MacOS/YourApp",
>          "This is not my path",
>          NULL);
>  }

The docs for execl(3) do state the convention:

The first argument, by convention, should point to the file name associated 
with the file being executed.

This being a Cocoa list we should expect that all conventions are being 
followed to the letter, by everyone, everywhere (though in this case I wouldn't 
bet the farm on it)._______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to