This is the mail archive of the cygwin 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: Symbolic links and file tests in perl


Scott Webster Wood wrote:

> I tried doing a if(-l $file) where $file was the name of a symbolically linked directory in the current working directory and it returned a false.  Doing a (-d $file) returned true.

I can't reproduce this:

$ mkdir foo; ln -s foo bar

$ perl -e 'print "yes\n" if (-l "bar");'
yes

Please provide a testcase that demonstrates the problem.

> Is there any way to work around this and then retrieve the real path of a symbolically linked directory under cygwin?

$ perl -e 'print readlink("bar")'
foo

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.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]