This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Symlink to script fails


I've been playing around with this, too. I have a Windows 'native' version of Perl 5.8.0 available to play with and when I used it, I got the same error as Andrew did.

I'm not sure how you did your cmd.exe test? I tried it, in the form of a shebang file. It 'worked' but it did complain about the shebank line not being recognized. But that's a side issue, just curious;-)

What I think is going on here has to do with how the "exec" for shebang does its thing. The interpreter named in the shebang line is exec'd, with the path name of the script file as an argument. I'd suggest that the Windows/DOS commands in question (my perl 5.8.0 and CQPerl) are unable to find the file, in the failing case, because they are reading a symlink, which they don't know how to deal with. So they are reading the content of the symlink, not what it points to.

I'm not sure why cmd.exe isn't having the same problem. Perhaps there's something in Windows/DOS program linking that needs to be done to get them to work with .lnk files? Like the business of linking into a program the ability to do wild card expansion.

lhall at pop dot ma dot ultranet dot com wrote:
I tried the same thing with c:/winnt/system32/cmd.exe (I don't have
CQPerl ;-) ) and it worked fine. Perhaps you can try that and see if it points to a CQPerl problem or some local configuration issue.



Larry


Original Message:
-----------------
From: Andrew DeFaria ADeFaria at Salira dot com
Date: Fri, 21 Feb 2003 10:41:45 -0800
To: cygwin at cygwin dot com
Subject: Symlink to script fails


I have need to use Rational's "CQPerl" which appears to be a derivative of Active State Perl that allows me to use Perl to access Clearquest. I have a perl script that does what I want however if I symlink that script the symlinked invocation does not work! I've drastically reduced the Perl script to simply demonstrate the problem:


$ cat foo
#!c:/Progra~1/Rational/ClearQuest/CQPerl
print "Hello world\n";
$ foo
Hello world
$ ls -l bar
lrwxrwxrwx    1 adefaria Domain U       86 Feb 21 10:38 bar -> foo*
$ bar
Can't open perl script "./bar": No such file or directory

Now if I change the shebang line to #!/bin/perl then everything works but as I said I need to use CQPerl.

Ideas?



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


-------------------------------------------------------------------- mail2web - Check your email from the web at http://mail2web.com/ .



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

-- Bob McGowan Staff Development Engineer VERITAS Software rmcgowan at veritas dot com


-- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]