From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; de-DE; rv:1.4.1) Gecko/20031114 Description of problem: We test to install additional software on Fedora Core 2. We test it on 2 different installations, different hardware and different CD sets. The install from the software fails. We found out that the listing in the filesystem is broken. A normally listing looks like. The software which we want install was a apache application. . .. one two On FC2 the listing looks like .. one two . First we thought it is a PHP problem but then we found out the the bug can be reproduced with a small C programm also. Here the PHP script <?php $d = opendir("/"); while (($f = readdir($d))) { echo $f ."\n"; } closedir($d); ?> The C script will follow here #include <stdio.h> #include <dirent.h> #include <sys/types.h> int main(int argc, char *argv[]){ char *path; DIR *d; struct dirent *f; if (argc > 1) { path = argv[1]; } else { path = "."; } d = opendir(path); if (d) { while ((f = readdir(d))) { printf("%s\n", f->d_name); } closedir(d); } else { printf("Failed to open directory '%s'\n", path); return -1; } return 0; } Version-Release number of selected component (if applicable): We don't know it is real a kernel problem How reproducible: Always Steps to Reproduce: 1. Copy the php script above to /var/www/html/ 2. Open a browser and se the output 3. Compile the c sript and execute it 4. see the result Actual Results: Directory listing as above .. one two . Additional info: The following output of your script confirms the problem:-------------- BOO ----------------------------- sys. proc boot sbin opt lost+found etc mnt dev .. tmp root . autofsck usr misc lib home initrd bin var selinux --------------- EOO -----------------------------
This isn't a bug. The order of file names in a directory is undefined. It used to approximate creation order (unless there were deletions), but now with the much faster directory hash does not. If you need a specific order you should be sorting them.