delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/08/16/21:14:25

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=BAYES_00,SPF_HELO_PASS,TW_CQ,TW_QP,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Andrew DeFaria <Andrew AT DeFaria DOT com>
Subject: Existence check fails on Cygwin Perl
Date: Mon, 16 Aug 2010 18:13:59 -0700
Lines: 32
Message-ID: <i4cnoo$tcr$1@dough.gmane.org>
Mime-Version: 1.0
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9pre) Gecko/20100805 Lightning/1.0b2 Lanikai/3.1.3pre
X-IsSubscribed: yes
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

  This is strange. I usually tend to use Cygwin's Perl as it is more 
full featured and works well but there are times when I am forced to use 
"cqperl" - a Perl that comes with Rational Clearquest - at my clients. 
Here it seems that Cygwin's Perl utterly fails the test where as cqperl 
- a derivative of ActiveuuState - works.

This is using the existence check (-e) for a file. The file happens to 
be on a share thus we are using UNC notation. It doesn't even matter if 
"server" is a real server or not, nor whether the share and path exist. 
Use anything you like. In fact use "server" and "path" and "file". 
Either way Cygwin's Perl reports that the file exists even when it 
doesn't, or the path is wrong or even if the server does not exist!

$ cat test.pl'
use warnings;
use strict;

# Obviously non-existant server and file
my $file = "\\\\server\\path\\file";

# Check for existance returns true for Cygwin - false for ActiveState
if (-e $file) {
   print "true\n"
} else {
   print "false\n"
}
$ perl test.pl
true
$ cqperl test.pl
false
$



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019