Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl opendir (ID, "/home/actionet/gallerymain") || print "Couldn't open dir +ectory for reading\n"; (@dir0) = readdir(ID) || print "Couldn't read directory contents.\n"; closedir(ID) || print "Couldn't close directory after reading contents +\n"; foreach $inode0 (@dir0) { print "File about to be processed is: $inode0\n"; next if ($inode0) =~ /^\./; $thefile = "/home/actionet/gallerymain" . $inode0; next if (-d $thefile); print "File to process is: $thefile\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: readdir fails?
by Juerd (Abbot) on Mar 03, 2002 at 00:45 UTC | |
|
•Re: readdir fails?
by merlyn (Sage) on Mar 03, 2002 at 02:56 UTC | |
by rob_au (Abbot) on Mar 03, 2002 at 05:09 UTC | |
|
Re: readdir fails?
by webadept (Pilgrim) on Mar 03, 2002 at 04:20 UTC |