This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Symbolic links and file tests in perl
- From: Brian Dessent <brian at dessent dot net>
- To: cygwin at cygwin dot com
- Date: Mon, 14 Apr 2008 20:49:32 -0700
- Subject: Re: Symbolic links and file tests in perl
- References: <709842.18785.qm@web38008.mail.mud.yahoo.com>
- Reply-to: cygwin at cygwin dot com
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/