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

Sounds like your new version of redhat has a subtle change to the readdir(2) operation (or maybe you changed the filesystem type you were on??). I am pretty sure that, in general, readdir simply returns the entries in the order that they appear in the file. You never used to see "." because it should always be the first entry in the directory file, and your script was discarding it. Now, for some reason, the first entry returned by readdir was not ".", but a file you cared about. Since opendir/readdir say nothing about entry ordering, "it's not a bug -- it's a feature":)

Replies are listed 'Best First'.
Re^4: readdir missing one file
by blazar (Canon) on Oct 18, 2008 at 12:27 UTC

    Indeed I had never relied on that behaviour myself, but on quite about every filesystem I had seen thus far would readdir return qw/. ../ as the first two entries, and yet I had never ever seen this described as a requirement, so I had always wondered if by any chance it were - except undocumented or documented in some arcane place: now we have at least one bit of experimental evidence it actually isn't. (Of course I'm not claiming to be a fs expert or let alone knowledgeable person, in which case I would have known better to start with...)

    --
    If you can't understand the incipit, then please check the IPB Campaign.