delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/04/26/01:41:34

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=BAYES_00,SARE_MSGID_LONG40
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <430f10bb0904252137y7cacd71r246187dac419484@mail.gmail.com>
References: <430f10bb0904252137y7cacd71r246187dac419484 AT mail DOT gmail DOT com>
Date: Sun, 26 Apr 2009 15:41:14 +1000
Message-ID: <430f10bb0904252241w6167f455ka42344c30a3293a8@mail.gmail.com>
Subject: Re: perl -r says readable dir is unreadable
From: Mikel Ward <mikel AT mikelward DOT com>
To: cygwin AT cygwin DOT com
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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

Sorry.

Found this
http://sourceware.org/ml/cygwin/2005-03/msg00488.html

Apparently it's been an issue since at least Perl 5.8.6 in 2005, but
probably longer.

On Sun, Apr 26, 2009 at 2:37 PM, Mikel Ward <mikel AT mikelward DOT com> wrote:
> Hi
>
> I'm having problems with a Perl script that works fine on Linux.
>
> The key is that the -r (file is readable) operator returns false for
> directories that I CAN read. =A0"test" and "ls" prove that I can read
> them.
>
> Something that might be related is that C:, C:\Windows, and others are
> owned by the "TrustedInstaller" user, which mkpasswd can't handle.
> http://www.nabble.com/group-%3D-(2**32-1)-%3D-4294967295-td20319853.html
>
> I use / as my Cygwin prefix rather than /cygdrive, but I've tried
> /cygdrive and it gives the same results.
>
> I'm running as myself, but running as Administrator also gives the same r=
esults.
>
> I'm running Vista.
>
> $ test -r /c/WINDOWS && echo "/c/WINDOWS is readable"
> /c/WINDOWS is readable
>
> $ cat ~/bin/readable
> #!/usr/bin/perl
>
> if (-r $ARGV[0]) {
> =A0 =A0 =A0 =A0print $ARGV[0] . " is readable\n";
> =A0 =A0 =A0 =A0exit 0;
> }
> else {
> =A0 =A0 =A0 =A0print $ARGV[0] . " IS NOT readable\n";
> =A0 =A0 =A0 =A0exit 1;
> }
>
> $ ~/bin/readable /c/WINDOWS
> /c/WINDOWS IS NOT readable
>
> $ cat ~/bin/pstat
> #!/usr/bin/perl
>
> ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksi=
ze,$blocks)
> =3D stat($ARGV[0]);
> print "mode =3D " . $mode . "\n";
>
> $ ~/bin/pstat /c/WINDOWS
> mode =3D 16888
>
> $ ls -l /c/WINDOWS | head
> ls: /c/WINDOWS/bthservsdp.dat: Permission denied
> ls: /c/WINDOWS/DUMP4352.tmp: Permission denied
> ls: /c/WINDOWS/LiveKernelReports: Permission denied
> ls: /c/WINDOWS/MEMORY.DMP: Permission denied
> ls: /c/WINDOWS/ModemLogs: Permission denied
> ls: /c/WINDOWS/Prefetch: Permission denied
> ls: /c/WINDOWS/Temp: Permission denied
> total 505455
> -rwx------+ =A0 =A01 Administrators None =A0 =A0 =A0 =A0 =A0 =A0 0 Jan =
=A02 10:58 AS_Debug.txt*
> drwxrwx---+ =A0 =A04 ???????? =A0 =A0 =A0 ???????? =A0 =A0 =A04096 Apr 15=
 07:30 AppPatch/
> drwxrwx---+ =A0 =A06 ???????? =A0 =A0 =A0 ???????? =A0 =A0 =A0 =A0 0 Nov =
23 13:52 Boot/
> drwxrwx---+ =A0 =A04 ???????? =A0 =A0 =A0 ???????? =A0 =A0 =A0 =A0 0 Nov =
=A02 =A02006 Branding/
> drwx------+ =A0 =A02 Administrators ???????? =A0 =A0 49152 Nov =A02 =A020=
06 Cursors/
> -rwx------+ =A0 =A01 Administrators None =A0 =A0 =A0 =A0 =A01171 Jan =A06=
 22:34 DIFx.log*
> -rwx------+ =A0 =A01 Administrators None =A0 =A0 =A0 =A0319456 Jan =A02 1=
0:59 DIFxAPI.dll*
> -rwx------+ =A0 =A01 SYSTEM =A0 =A0 =A0 =A0 SYSTEM =A0 =A0 =A0 17932 Jan =
=A06 23:13 DPINST.LOG*
> ---------- =A0 =A0 1 ???????? =A0 =A0 =A0 ???????? 212167315 Nov 20 22:51=
 DUMP4352.tmp
>
> $ perl -version
>
> This is perl, v5.10.0 built for cygwin-thread-multi-64int
> (with 6 registered patches, see perl -V for more detail)
>
> Copyright 1987-2007, Larry Wall
>
> Perl may be copied only under the terms of either the Artistic License or=
 the
> GNU General Public License, which may be found in the Perl 5 source kit.
>
> Complete documentation for Perl, including FAQ lists, should be found on
> this system using "man perl" or "perldoc perl". =A0If you have access to =
the
> Internet, point your browser at http://www.perl.org/, the Perl Home Page.
>

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

- Raw text -


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