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" To: cygwin AT cygwin DOT com User-Agent: SquirrelMail/1.5.1 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes 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 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/