Re: Existence check fails on Cygwin Perl

2010-08-17 Thread Lemke, Michael SZ/HZA-ZSB2
On Tue, 17 Aug 2010 16:19:40 +0200, Corinna Vinschen wrote:
>On Aug 17 14:58, Lemke, Michael  SZ/HZA-ZSB2 wrote:
>> Now that 1.7.6 has appeared at my favorite mirror I repeated the
test:
>> 
>> pc> uname -a
>> CYGWIN_NT-5.1 p01080268 1.7.6(0.230/5/3) 2010-08-16 16:06 i686 Cygwin
>> pc> ls -ls //junk/file
>> ls: cannot access //junk/file: No such file or directory
>> 
>> Great, it's fixed.
>> 
>> But wait:
>> 
>> pc> ls -ls //server/junk
>> 0 -rw-r--r-- 1 lemkemch Domain Users 0 Dec  1  2006 //server/junk
>> 
>> I was wrong above, here is a server called 'server'.  But it doesn't
have
>> a file 'junk'.
>>  
>> Doing the equivalent from a DOS box:
>> 
>> U:\>dir \\server\junk
>> Logon failure: unknown user name or bad password.
>
>Works for me if the server called "server" exists, but has no
>share named "junk".
>
>  bash$ ls -ls //server/junk
>  ls: cannot access //server/cygwinx: No such file or directory
>
>The noticable difference is that the access returns another error
>on the Win32/native NT level:
>
>  C:\>dir \\server\junk
>  The network name cannot be found.
>
>So there's YA error possible when accessing a non-existant share.
>Great!  To fix this for Cygwin 1.7.7, I need an strace from you:
>
>  bash$ strace -o share-logon-failure.trace ls //server/junk
>
>Just send the share-logon-failure.trace file as attachment.

Can I send this as PM to you instead?

This is via a regular domain login BTW, no ssh or anything.

I guess, the interesting part is this:

   30   14511 [main] ls 3504 normalize_posix_path: src //server/junk
   27   14538 [main] ls 3504 normalize_posix_path: //server/junk =
normalize_posix_path (//server/junk)
   27   14565 [main] ls 3504 mount_info::conv_to_win32_path:
conv_to_win32_path (//server/junk)
   26   14591 [main] ls 3504 set_flags: flags: text (0x200)
   25   14616 [main] ls 3504 mount_info::conv_to_win32_path: src_path
//server/junk, dst \\server\junk, flags 0x2004020, rc 0
536559  551175 [main] ls 3504 symlink_info::check: 0xC06D =
NtCreateFile (1:\??\UNC\server\junk)
   72  551247 [main] ls 3504 symlink_info::check: 0xC06D =
NtQueryInformationFile (\??\UNC\server\junk)
   54  551301 [main] ls 3504 symlink_info::check: 0xC033 =
NtOpenFile(\??\UNC\server\)
   27  551328 [main] ls 3504 symlink_info::check: not a symlink
   25  551353 [main] ls 3504 symlink_info::check: 0 = symlink.check
(\\server\junk, 0x22B760) (0x2404020)
169010  720363 [main] ls 3504 fs_info::update: Cannot get volume
attributes (\??\UNC), C010
   91  720454 [main] ls 3504 build_fh_pc: fh 0x6123B13C
   31  720485 [main] ls 3504 stat_worker: (\??\UNC\server\junk,
0x6BA1C0, 0x6123B13C), file_attributes 0
   36  720521 [main] ls 3504 fhandler_base::open: (\??\UNC\server\junk,
0x11)
170319  890840 [main] ls 3504 seterrno_from_nt_status:
/ext/build/netrel/src/cygwin-1.7.6-1/winsup/cygwin/fhandler.cc:590
status 0xC06D -> windows error 1326
   61  890901 [main] ls 3504 geterrno_from_win_error: unknown windows
error 1326, setting errno to 13
   28  890929 [main] ls 3504 fhandler_base::open: C06D =
NtCreateFile (0x0, 8010, \??\UNC\server\junk, io, NULL, 0, 7, 1,
4020, NULL, 0)
   28  890957 [main] ls 3504 fhandler_base::open: 0 =
fhandler_base::open (\??\UNC\server\junk, 0x11)
   28  890985 [main] ls 3504 fhandler_base::open_fs: 0 =
fhandler_disk_file::open (\??\UNC\server\junk, 0x1)
   31  891016 [main] ls 3504 fhandler_base::open: (\??\UNC\server\junk,
0x11)
169508 1060524 [main] ls 3504 seterrno_from_nt_status:
/ext/build/netrel/src/cygwin-1.7.6-1/winsup/cygwin/fhandler.cc:590
status 0xC06D -> windows error 1326
   49 1060573 [main] ls 3504 geterrno_from_win_error: unknown windows
error 1326, setting errno to 13
   33 1060606 [main] ls 3504 fhandler_base::open: C06D =
NtCreateFile (0x0, 20080, \??\UNC\server\junk, io, NULL, 0, 7, 1, 4000,
NULL, 0)
   27 1060633 [main] ls 3504 fhandler_base::open: 0 =
fhandler_base::open (\??\UNC\server\junk, 0x11)
   24 1060657 [main] ls 3504 fhandler_base::open_fs: 0 =
fhandler_disk_file::open (\??\UNC\server\junk, 0x1)
   54 1060711 [main] ls 3504 fhandler_base::fstat_by_name: 0xC033 =
NtOpenFile(\??\UNC\server\junk)
   49 1060760 [main] ls 3504 fhandler_base::fstat_helper: 0xC03B =
NtOpenFile(\??\UNC\server\junk)
   27 1060787 [main] ls 3504 fhandler_base::fstat_helper: 0 = fstat
(\??\UNC\server\junk, 0x6BA1C0) st_atime=456F7080 st_size=0,
st_mode=0x81A4, st_ino=6244810932582208719, sizeof=96
   36 1060823 [main] ls 3504 stat_worker: 0 = (\??\UNC\server\junk,
0x6BA1C0)


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



Re: Existence check fails on Cygwin Perl

2010-08-17 Thread Andrew DeFaria

 On 08/17/2010 02:06 AM, Corinna Vinschen wrote:

I can't reproduce, but I'm already running Cygwin 1.7.6.  I have a vague
memory that we already had a report along these lines and that I patched
this at one point...  I *think* that's what is successfully hidden
behind the "Fix erroneous handling of devices in path checking." message
in the announcement...


Corinna

Oh fudge! Great. You know corp America - always back a few versions! 
They'll never get up to the newest version of Cygwin before my contract 
runs out!


But thanks, I guess it's time for me to update Cygwin again... I knew it 
would come does to something in Cygwin's handling of such UNC paths.


--
Andrew DeFaria 
I was thinking that women should put pictures of missing husbands on 
beer cans.



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



Re: Existence check fails on Cygwin Perl

2010-08-17 Thread Corinna Vinschen
On Aug 17 16:19, Corinna Vinschen wrote:
> On Aug 17 14:58, Lemke, Michael  SZ/HZA-ZSB2 wrote:
> > But wait:
> > 
> > pc> ls -ls //server/junk
> > 0 -rw-r--r-- 1 lemkemch Domain Users 0 Dec  1  2006 //server/junk
> > 
> > I was wrong above, here is a server called 'server'.  But it doesn't have
> > a file 'junk'.
> >  
> > Doing the equivalent from a DOS box:
> > 
> > U:\>dir \\server\junk
> > Logon failure: unknown user name or bad password.
> 
> Works for me if the server called "server" exists, but has no
> share named "junk".
> 
>   bash$ ls -ls //server/junk
>   ls: cannot access //server/cygwinx: No such file or directory
> 
> The noticable difference is that the access returns another error
> on the Win32/native NT level:
> 
>   C:\>dir \\server\junk
>   The network name cannot be found.
> 
> So there's YA error possible when accessing a non-existant share.
> Great!  To fix this for Cygwin 1.7.7, I need an strace from you:
> 
>   bash$ strace -o share-logon-failure.trace ls //server/junk
> 
> Just send the share-logon-failure.trace file as attachment.

...and a follow-up question:

  Are you running your test from a ssh session, by any chance?
  If so, what kind of authentication are you using, in terms of
  the different methods explained in
  http://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-setuid-overview


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



Re: Existence check fails on Cygwin Perl

2010-08-17 Thread Corinna Vinschen
On Aug 17 14:58, Lemke, Michael  SZ/HZA-ZSB2 wrote:
> Now that 1.7.6 has appeared at my favorite mirror I repeated the test:
> 
> pc> uname -a
> CYGWIN_NT-5.1 p01080268 1.7.6(0.230/5/3) 2010-08-16 16:06 i686 Cygwin
> pc> ls -ls //junk/file
> ls: cannot access //junk/file: No such file or directory
> 
> Great, it's fixed.
> 
> But wait:
> 
> pc> ls -ls //server/junk
> 0 -rw-r--r-- 1 lemkemch Domain Users 0 Dec  1  2006 //server/junk
> 
> I was wrong above, here is a server called 'server'.  But it doesn't have
> a file 'junk'.
>  
> Doing the equivalent from a DOS box:
> 
> U:\>dir \\server\junk
> Logon failure: unknown user name or bad password.

Works for me if the server called "server" exists, but has no
share named "junk".

  bash$ ls -ls //server/junk
  ls: cannot access //server/cygwinx: No such file or directory

The noticable difference is that the access returns another error
on the Win32/native NT level:

  C:\>dir \\server\junk
  The network name cannot be found.

So there's YA error possible when accessing a non-existant share.
Great!  To fix this for Cygwin 1.7.7, I need an strace from you:

  bash$ strace -o share-logon-failure.trace ls //server/junk

Just send the share-logon-failure.trace file as attachment.


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



Re: Existence check fails on Cygwin Perl

2010-08-17 Thread Lemke, Michael SZ/HZA-ZSB2
On Tue, 17 Aug 2010 12:03:19 +0200, Corinna Vinschen wrote:
>On Aug 17 10:47, Andy Koppe wrote:
>> On 17 August 2010 10:06, Corinna Vinschen wrote:
>> > On Aug 17 10:54, Lemke, Michael ÂSZ/HZA-ZSB2 wrote:
>> >> On 17 Aug 2010 10:20:41 +0200, Corinna Vinschen wrote:
>> >> >On Aug 16 18:13, Andrew DeFaria wrote:

[perl example removed.]

>> >>
>> >> 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.
>> >
>> > I can't reproduce, but I'm already running Cygwin 1.7.6. ÂI have a vague
>> > memory that we already had a report along these lines and that I patched
>> > this at one point... ÂI *think* that's what is successfully hidden
>> > behind the "Fix erroneous handling of devices in path checking." message
>> > in the announcement...
>> 
>> http://www.cygwin.com/ml/cygwin/2010-06/msg00049.html
>
>Oh, right, thanks.  I have to refurbish my memory, I guess.

Now that 1.7.6 has appeared at my favorite mirror I repeated the test:

pc> uname -a
CYGWIN_NT-5.1 p01080268 1.7.6(0.230/5/3) 2010-08-16 16:06 i686 Cygwin
pc> ls -ls //junk/file
ls: cannot access //junk/file: No such file or directory

Great, it's fixed.

But wait:

pc> ls -ls //server/junk
0 -rw-r--r-- 1 lemkemch Domain Users 0 Dec  1  2006 //server/junk

I was wrong above, here is a server called 'server'.  But it doesn't have
a file 'junk'.
 
Doing the equivalent from a DOS box:

U:\>dir \\server\junk
Logon failure: unknown user name or bad password.


Michael

P.S. Sorry for breaking the thread, can't do any better at the moment.

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



Re: Existence check fails on Cygwin Perl

2010-08-17 Thread Reini Urban
2010/8/17 Nellis, Kenneth :
>> From: Corinna Vinschen
>> 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!
>> >
> 
>>
>> 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
>
> FWIW, I was able to reproduce the OP's results, both with Cygwin's
> Perl 5.10.1 and cqperl v5.8.6. I hadn't had any BLODA issues to
> date.

Sure. You need a recent cygwin snapshot to get it fixed.
  http://www.cygwin.com/ml/cygwin/2010-06/msg00049.html
  http://cygwin.com/snapshots/

$ [ -e //server/junk ] && date
$ uname -a
CYGWIN_NT-6.1 ATGRZWN503050 1.7.6s(0.230/5/3) 20100816 13:53:13 i686 Cygwin
-- 
Reini Urban

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



RE: Existence check fails on Cygwin Perl

2010-08-17 Thread Nellis, Kenneth
> From: Corinna Vinschen
> 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!
> >

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

FWIW, I was able to reproduce the OP's results, both with Cygwin's
Perl 5.10.1 and cqperl v5.8.6. I hadn't had any BLODA issues to
date.

--Ken Nellis


Re: Existence check fails on Cygwin Perl

2010-08-17 Thread Corinna Vinschen
On Aug 17 10:47, Andy Koppe wrote:
> On 17 August 2010 10:06, Corinna Vinschen wrote:
> > On Aug 17 10:54, Lemke, Michael  SZ/HZA-ZSB2 wrote:
> >> On 17 Aug 2010 10:20:41 +0200, Corinna Vinschen wrote:
> >> >On Aug 16 18:13, Andrew DeFaria wrote:
> >> >> $ 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.
> >>
> >> 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.
> >
> > I can't reproduce, but I'm already running Cygwin 1.7.6.  I have a vague
> > memory that we already had a report along these lines and that I patched
> > this at one point...  I *think* that's what is successfully hidden
> > behind the "Fix erroneous handling of devices in path checking." message
> > in the announcement...
> 
> http://www.cygwin.com/ml/cygwin/2010-06/msg00049.html

Oh, right, thanks.  I have to refurbish my memory, I guess.


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



Re: Existence check fails on Cygwin Perl

2010-08-17 Thread Andy Koppe
On 17 August 2010 10:06, Corinna Vinschen wrote:
> On Aug 17 10:54, Lemke, Michael  SZ/HZA-ZSB2 wrote:
>> On 17 Aug 2010 10:20:41 +0200, Corinna Vinschen wrote:
>> >On Aug 16 18:13, Andrew DeFaria wrote:
>> >> $ 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.
>>
>> 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.
>
> I can't reproduce, but I'm already running Cygwin 1.7.6.  I have a vague
> memory that we already had a report along these lines and that I patched
> this at one point...  I *think* that's what is successfully hidden
> behind the "Fix erroneous handling of devices in path checking." message
> in the announcement...

http://www.cygwin.com/ml/cygwin/2010-06/msg00049.html

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



Re: Existence check fails on Cygwin Perl

2010-08-17 Thread Corinna Vinschen
On Aug 17 10:54, Lemke, Michael  SZ/HZA-ZSB2 wrote:
> On 17 Aug 2010 10:20:41 +0200, Corinna Vinschen wrote:
> >On Aug 16 18:13, Andrew DeFaria wrote:
> >> $ 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.
> 
> 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.

I can't reproduce, but I'm already running Cygwin 1.7.6.  I have a vague
memory that we already had a report along these lines and that I patched
this at one point...  I *think* that's what is successfully hidden
behind the "Fix erroneous handling of devices in path checking." message
in the announcement...


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



Re: Existence check fails on Cygwin Perl

2010-08-17 Thread Lemke, Michael SZ/HZA-ZSB2
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.
>> 
>> 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.

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=0,user,noumount,auto)
I: on /i type vfat (text,posix=0,user,noumount,auto)
J: on /j type ntfs (text,posix=0,user,noumount,auto)
K: on /k type unknown (text,posix=0,user,noumount,auto)
Q: on /q type ntfs (text,posix=0,user,noumount,auto)
S: on /s type ntfs (text,posix=0,user,noumount,auto)
V: on /v type ntfs (text,posix=0,user,noumount,auto) 

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



Re: Existence check fails on Cygwin Perl

2010-08-17 Thread Corinna Vinschen
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



Existence check fails on Cygwin Perl

2010-08-16 Thread Andrew DeFaria
 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