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. "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 results. 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]) { print $ARGV[0] . " is readable\n"; exit 0; } else { print $ARGV[0] . " IS NOT readable\n"; exit 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,$blksize,$blocks) = stat($ARGV[0]); print "mode = " . $mode . "\n"; $ ~/bin/pstat /c/WINDOWS mode = 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------+ 1 Administrators None 0 Jan 2 10:58 AS_Debug.txt* drwxrwx---+ 4 ???????? ???????? 4096 Apr 15 07:30 AppPatch/ drwxrwx---+ 6 ???????? ???????? 0 Nov 23 13:52 Boot/ drwxrwx---+ 4 ???????? ???????? 0 Nov 2 2006 Branding/ drwx------+ 2 Administrators ???????? 49152 Nov 2 2006 Cursors/ -rwx------+ 1 Administrators None 1171 Jan 6 22:34 DIFx.log* -rwx------+ 1 Administrators None 319456 Jan 2 10:59 DIFxAPI.dll* -rwx------+ 1 SYSTEM SYSTEM 17932 Jan 6 23:13 DPINST.LOG* ---------- 1 ???????? ???????? 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". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page.
cygcheck.out
Description: Binary data
-- 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/