X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Tue, 17 Aug 2010 10:20:41 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Existence check fails on Cygwin Perl Message-ID: <20100817082041.GA16295@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Aug 16 18:13, Andrew DeFaria wrote: > 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 > $ I can not reproduce your problem. I used "\\\\server\\path\\file" unchanged, as well as valid server and share names and just a non-existant file name. In both cases the script prints "false". And it prints "true" for an existing file, just as expected. BLODA? Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- 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