www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/01/08/10:07:30

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f
From: sandmann AT clio DOT rice DOT edu (Charles Sandmann)
Message-Id: <10201081508.AA23429@clio.rice.edu>
Subject: Re: bash's 'test' is inconsistent on XP (causing autoconf testsuite failures)
To: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii)
Date: Tue, 8 Jan 2002 09:08:20 -0600 (CST)
Cc: djgpp-workers AT delorie DOT com, tim DOT van DOT holder AT pandora DOT be (Tim Van Holder)
In-Reply-To: <Pine.SUN.3.91.1020108110849.21206U-100000@is> from "Eli Zaretskii" at Jan 08, 2002 11:15:11 AM
X-Mailer: ELM [version 2.5 PL2]
Mime-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> 
> 
> On Tue, 8 Jan 2002, Charles Sandmann wrote:
> 
> > _truename fails for devices on Win2K (both calls, original and fixpathed).
> > findfirst succeeds.  The return name is the 3 character item (nul, con, etc).
> > The return time field is zero, date field is 33).  Size is zero.  As noted
> > above, attribute byte is incorrect (doesn't set device).
> > 
> > Suggestion:
> > 1) If truename failed (but findfirst is OK), and
> > 2) If size is zero, and
> > 3) If date+time field is the unique "device time", and 
> > 4) If os_trueversion is 0x532 and LFN, and 
> > 5) (maybe) if returned file name length == 3
> > 
> > Then we set the 0x40 bit in the attribute byte and let lstat handle it ?
> 
> Sounds like a good idea; the telltale ``device time'' is especially 
> promising.

I coded this up quickly last night and it seems to work.

> But please don't use 5): device names can be up to 8 characters (e.g. 
> EMMXXXX0 used by expanded memory managers), so we cannot limit them to 3 
> characters.  Perhaps the lack of slashes is a better sign, since 
> _truename is supposed to return a fully-qualified file name.

_truename fails, so this is the return from findfirst.  One other thing
I thought of checking was that this was a LFN32 findfirst and that all 3
times were the "device time" (1/1/80).  Even more difficult to have a
real file with the last access time being 1/1/80 ...

> Alternatively, we could call the SFN version of _truename in addition to 
> the LFN version, perhaps only if we suspect a device under W2K/XP.

I'd like to keep it simple if possible.  The current code works, is small,
no additional interrupts.

- Raw text -


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