in reply to Re^2: readdir missing one file
in thread readdir missing one file

It was a problem before! That's why you never saw the '.' directory; you discarded it. Obviously, in the past you got the files from readdir ordered, with the '.' and '..' directories in front and that's not the case on RH (and shouldn't be depended on).

Paul

Replies are listed 'Best First'.
Re^4: readdir missing one file
by mpeever (Friar) on Oct 17, 2008 at 17:08 UTC
    Exactly! Reading a file or directory alters the system by incrementing pointers: it's best to read only once, but if you read more than once, at least limit your reads to once place. This sort of thing is exactly why I started reading like this:
    my $path = "/path/to/whatever"; opendir (DIR, $path) or die "Can't read $path: $!"; my @files = grep { not /^\.{1,2}$/ } readdir (DIR); closedir (DIR); print join("\n", sort @files), "\n";