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":)