in reply to readdir missing one file
I also always have to filter out ".", ".." and "". I have never NOT had to filter them out. Also check a folder you know you have complete access (maybe one you made) - could be permissions. -M$somepath = '/path/to/anywhere'; opendir(DIR, $somepath) or warn "Can't open that directory : $!\n"; @files = ('', readdir(DIR)); foreach $file (@files) { push @keepers, "\"$file\"\n" if ($file ne '' and $file ne '..' and $file ne '.'); } closedir(DIR); print $#keepers + 1 . " files encountered :\n" . join("",@keepers);
|
|---|