This is the mail archive of the
mailing list for the Cygwin project.
Re: Possible bug in exec with symlink.
On Tue, Dec 05, 2000 at 05:02:15PM -0800, Mo DeJong wrote:
>On Tue, 5 Dec 2000, Christopher Faylor wrote:
>> Cygwin sets the argv to be the name of the file which
>> invoked the script.
>> In this case, that's 'mygcc'. 'mygcc' is a symbolic link to a script
>> which is running a non-cygwin program. The program is apparently
>> looking at argv for some kind of inspiration but is unable to
>> decipher cygwin's symlink.
>Ahh, yes that is the problem. The Tcl shell is not a Cygwin
>app so it does not know how to follow the symlink.
>% set fd [open ip2k-elf-gcc r]
>% read $fd
>It tries to run "<symlink>fake_toolchain" and puked on that.
>> So, I think that Cygwin is behaving appropriately.
>Thanks, I guess I will have to find some other way
>to implement this.
I thought that most modern shells had some kind of command to dereference
symbolic links like 'truename' or 'realname' or something like that.
I thought I'd used this kind of functionality for this kind of problem
in the past but apparently I was hallucinating since I can't figure out
how to do this now.
You could do something like a 'ls -l $0' and parse the output from that
but that's sort of ugly.
Want to unsubscribe from this list?
Send a message to firstname.lastname@example.org