Mail Archives: djgpp/1996/09/18/07:41:23
Using routines mentioned above to write a Unix-compatible, directory browsing
code, I have stumbled upon one small problem. The proggy I wrote was reporting
that a directory contains, say, 1.7MB of files, when in reality there was over
2.0MB. Investigating the problem, I found out that readdir() & glob() are
using findfirst()/findnext() to collect filenames from the directory. However,
they are not telling find..() to look for all files. Every directory entry
which has a Hid/Sys attribute set doesn't get reported. This is inconsistent
(at least in case of readdir()) with the documentation and behavior on Unix.
readdir() is supposed to return EVERY entry in directory. On Unix it reads
physical dirents, reporting all of them. I consider this being a bug because
it causes the code to work differently on MS-DOG and Unix.
It's just came to my mind. Are the hid/sys files on DOS are supposed to be
treated like files without appropriate permissions on Unix. Even so, readdir()
is supposed to report EVERY entry in directory.
Mark
**********************************************************************
So if you ask me how do I feel inside, I could honestly tell you we've
been taken on a very long ride. And if my owners let me have free time
some day, with all good intention I would probably run away!
Clutching the short straw...
******************* http://ananke.amu.edu.pl/~grendel ****************
- Raw text -