Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I really want to create a message if I dont have permission to "$startDir". Why wont my print statement ("no permissions to start Directory") work??use strict; use File::Find; my $startDir = '\directory\myNTpath'; unless (-d $startDir) { die "Directory '$startDir' is not a Directory.\n"; } if(! -r $startDir) #also tried -x and -w here but it never works { #this never prints even if I have no permissions in directory print "no permissions to start Directory\n"; } find(\&processSub, $startDir); sub processSub { print "Found $File::Find::name\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File Find permissions check
by hardburn (Abbot) on Jul 07, 2003 at 14:06 UTC | |
by Abigail-II (Bishop) on Jul 07, 2003 at 14:20 UTC | |
by Anonymous Monk on Jul 07, 2003 at 14:12 UTC | |
by ant9000 (Monk) on Jul 07, 2003 at 14:28 UTC | |
by Anonymous Monk on Jul 07, 2003 at 15:02 UTC |