public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Symbolic links and file tests in perl
@ 2008-04-14 22:30 Scott Webster Wood
  2008-04-15  6:05 ` Brian Dessent
  0 siblings, 1 reply; 2+ messages in thread
From: Scott Webster Wood @ 2008-04-14 22:30 UTC (permalink / raw)
  To: cygwin

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.
Is there any way to work around this and then retrieve the real path of a symbolically linked directory under cygwin?

SW




      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

--
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/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Symbolic links and file tests in perl
  2008-04-14 22:30 Symbolic links and file tests in perl Scott Webster Wood
@ 2008-04-15  6:05 ` Brian Dessent
  0 siblings, 0 replies; 2+ messages in thread
From: Brian Dessent @ 2008-04-15  6:05 UTC (permalink / raw)
  To: cygwin

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/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-04-15  3:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-14 22:30 Symbolic links and file tests in perl Scott Webster Wood
2008-04-15  6:05 ` Brian Dessent

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).