X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=0.3 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,TW_CQ,TW_QP X-Spam-Check-By: sourceware.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable x-cr-puzzleid: {1743B463-11E3-402D-A9EF-B60E16BF77A4} x-cr-hashedpuzzle: AaN9 AfCD BpSd Bs89 B8Yq EMdD ElC/ FFQD Fcib FvND HP1g H3ek IH3W IrhI IwEF J2ma;1;YwB5AGcAdwBpAG4AQABjAHkAZwB3AGkAbgAuAGMAbwBtAA==;Sosha1_v1;7;{1743B463-11E3-402D-A9EF-B60E16BF77A4};bABlAG0AawBlAG0AYwBoAEAAcwBjAGgAYQBlAGYAZgBsAGUAcgAuAGMAbwBtAA==;Tue, 17 Aug 2010 08:54:56 GMT;UgBlADoAIABFAHgAaQBzAHQAZQBuAGMAZQAgAGMAaABlAGMAawAgAGYAYQBpAGwAcwAgAG8AbgAgAEMAeQBnAHcAaQBuACAAUABlAHIAbAA= Content-class: urn:content-classes:message Subject: Re: Existence check fails on Cygwin Perl Date: Tue, 17 Aug 2010 10:54:55 +0200 Message-ID: <010016E11294264BB30D58894AB4040D02B1FE18@de010369.de.ina.com> From: "Lemke, Michael SZ/HZA-ZSB2" To: Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 17 Aug 2010 10:20:41 +0200, Corinna Vinschen wrote: >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. >>=20 >> 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! >>=20 >> $ cat test.pl' >> use warnings; >> use strict; >>=20 >> # Obviously non-existant server and file >> my $file =3D "\\\\server\\path\\file"; >>=20 >> # 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. Hm, I can reproduce it and it's even simpler, no perl involved: pc> [ -e //server/junk ] && date Tue Aug 17 10:28:14 WEDT 2010 pc> ls -ls //server/junk 0 -rw-r--r-- 1 lemkemch Domain Users 0 Dec 1 2006 //server/junk Here's no server called server. pc> uname -a CYGWIN_NT-5.1 p01080268 1.7.5(0.225/5/3) 2010-04-12 19:07 i686 Cygwin pc> mount C:/MyStuff/1.7cygwin/bin on /usr/bin type ntfs (binary,auto) C:/MyStuff/1.7cygwin/lib on /usr/lib type ntfs (binary,auto) C:/MyStuff/cygwin/home on /home type ntfs (text) C:/MyStuff/1.7cygwin on / type ntfs (binary,auto) U: on /u type ntfs (text) C: on /c type ntfs (text,posix=3D0,user,noumount,auto) I: on /i type vfat (text,posix=3D0,user,noumount,auto) J: on /j type ntfs (text,posix=3D0,user,noumount,auto) K: on /k type unknown (text,posix=3D0,user,noumount,auto) Q: on /q type ntfs (text,posix=3D0,user,noumount,auto) S: on /s type ntfs (text,posix=3D0,user,noumount,auto) V: on /v type ntfs (text,posix=3D0,user,noumount,auto)=20 Michael -- 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