| delorie.com/archives/browse.cgi | search |
| X-Recipient: | archive-cygwin AT delorie DOT com |
| X-Spam-Check-By: | sourceware.org |
| Message-ID: | <480425CC.A434CFFF@dessent.net> |
| Date: | Mon, 14 Apr 2008 20:49:32 -0700 |
| From: | Brian Dessent <brian AT dessent DOT net> |
| X-Mailer: | Mozilla 4.79 [en] (Windows NT 5.0; U) |
| MIME-Version: | 1.0 |
| To: | cygwin AT cygwin DOT com |
| Subject: | Re: Symbolic links and file tests in perl |
| References: | <709842 DOT 18785 DOT qm AT web38008 DOT mail DOT mud DOT yahoo DOT com> |
| X-IsSubscribed: | yes |
| Reply-To: | cygwin AT cygwin DOT com |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Id: | <cygwin.cygwin.com> |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sourceware.org/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list 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/
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |