delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/13/05:32:16

Date: Sun, 13 Feb 2000 10:17:26 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: John & Susie <jdk AT sgi DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: __file_tree_walk problem??
In-Reply-To: <38A4D3B0.6C292ED8@sgi.net>
Message-ID: <Pine.SUN.3.91.1000213101615.29873Z-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: dj-admin AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Fri, 11 Feb 2000, John & Susie wrote:

> This is a sampling of the output (tmp.txt) run in DOS 6.x (d: is a 450~
> MB FAT16 partition)

On what operating system did you run that program?  If that was
Windows 9X, is it possible that you had LFN set to N in the
environment?

FWIW, I ran your program under Windows 95 on two large disks, and
didn't see even a single RHSV entry.  There are several RHSA files,
which is expected (these are real hidden files used by several
utilities and by Windows itself), but no RHSV.

> d:./Bg:	4294967295	RHSV  <<---------------????
> 
> The problem: The files flagged <<------- ??? don't exist!

Of course, they don't exist: these are fake directory entries used by
Windows to store the long file names.  Several such entries are needed
to store a long file name, since there's space for only 13 characters
(Unicode-encoded) in each standard FAT 32-byte directory entry.
Windows sets the attribute byte of such ``files'' to the impossible
combination "RHSV" (read-only, hidden, system, and volume) because
most DOS programs disregard files with such a crazy combination of
attribute bits.

But I'm curious how did you get those entries visible from a DJGPP
program.  If you didn't set LFN=n in the environment, the only way I
could imagine this to happen is if you had some files that were
created under Windows, but then deleted under DOS.  This would leave
behind the extra directory entries used by Windows, because DOS system
calls don't see them and don't remove them.  If you run SCANDISK
(under Windows) on that partition, it would probably complain about
all those entries and suggest to delete them.

To make the long story short: programs that walk directories need to
skip files which have all of RHSV bits set in the attribute byte.
(Library functions like `stat' took quite a few iterations to get
there ;-)

- Raw text -


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