www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/09/18/07:41:23

Newsgroups: comp.os.msdos.djgpp
Date: Wed, 18 Sep 1996 13:20:22 +0200 (MET DST)
From: Mark Habersack <grendel AT ananke DOT amu DOT edu DOT pl>
Reply-To: grendel AT ananke DOT amu DOT edu DOT pl
cc: djgpp AT delorie DOT com, DJ Delorie <dj AT delorie DOT com>,
Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Subject: 1 bug(?) open/readdir & glob
Message-ID: <Pine.NEB.3.95.960918130759.170I-100000@ananke.amu.edu.pl>
MIME-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019