delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/04/26/00:52:56

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_05,SPF_HELO_PASS,SPF_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <51915.71.231.142.212.1240721560.squirrel@webmail.efn.org>
In-Reply-To: <430f10bb0904252137y7cacd71r246187dac419484@mail.gmail.com>
References: <430f10bb0904252137y7cacd71r246187dac419484 AT mail DOT gmail DOT com>
Date: Sat, 25 Apr 2009 21:52:40 -0700 (PDT)
Subject: Re: perl -r says readable dir is unreadable
From: "Yitzchak Scott-Thoennes" <sthoenna AT efn DOT org>
To: cygwin AT cygwin DOT com
User-Agent: SquirrelMail/1.5.1
MIME-Version: 1.0
X-IsSubscribed: yes
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

On Sat, April 25, 2009 9:37 pm, Mikel Ward wrote:
> The key is that the -r (file is readable) operator returns false for
> directories that I CAN read.  "test" and "ls" prove that I can read them.

-r does not test to see if you can read a file, it tests whether the mode
gives you read access to the file.

> $ ~/bin/pstat /c/WINDOWS
> mode = 16888

(= 040770) And it does not.

This may help:  use filetest "access";
(see http://search.cpan.org/perldoc/filetest)

but the only guaranteed cross-platform way to see if you can read a file
is to try to read it.


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