|
From: | Gregory Casamento |
Subject: | Re: NSTask: launchpath |
Date: | Sun, 9 Dec 2012 12:47:21 -0500 |
The execve(...) function in - (void)launch is being called with the full set of environment variables for the current user. This is why it's able to find the binary when you just do "diff." Additionally, the launch method does not validate that there is an executable at the path given before it runs execve(...). If the Cocoa behavior is desired then there should be a check for a valid executable before the call to execve which aborts the -(void)launch method.GC--On Sun, Dec 9, 2012 at 12:15 PM, Riccardo Mottola <riccardo.mottola@libero.it> wrote:
Hi,
while comparing code behavour between Cocoa and GNUstep I noticed that gnustep is capable of just esecuting a task with the executable. E.g. I can say "diff" as launchpath (which resides in /usr/bin/diff) and NSTask will execute on GNUstep, but not on Cocoa. On cocoa I need to specify "/usr/bin/diff". The executable is in a standard place.
Which behaviour is correct? I read the documentation and it says :
/path/
The path to the executable.
Which leads to think that the Apple behaviour is consistent, since it implies the whole path.
What do you think?
Riccardo
_______________________________________________
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Gregory Casamento
Open Logic Corporation, Principal Consultant
yahoo/skype: greg_casamento, aol: gjcasa
(240)274-9630 (Cell)
http://www.gnustep.org
http://heronsperch.blogspot.com
[Prev in Thread] | Current Thread | [Next in Thread] |