This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: perl -r says readable dir is unreadable
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/