www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/01/08/01:12:47

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: <10201080614.AA26269@clio.rice.edu>
Subject: Re: bash's 'test' is inconsistent on XP (causing autoconf testsuite failures)
To: djgpp-workers AT delorie DOT com, eliz AT is DOT elta DOT co DOT il (Eli Zaretskii)
Date: Tue, 8 Jan 2002 00:14:12 -0600 (CST)
Cc: tim DOT van DOT holder AT pandora DOT be (Tim Van Holder)
In-Reply-To: <Pine.SUN.3.91.1020106155059.2949A-100000@is> from "Eli Zaretskii" at Jan 06, 2002 03:56:08 PM
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

> IIRC, Charles found out that the LFN version of findfirst doesn't set the 
> 6th bit in the attributes for devices, and the LFN version of _truename 
> doesn't return devices with a forward slash (as in "C:/NUL"), so both of 
> the methods used by lstat to detect devices don't work.  We must find 
> some way to work around this.

_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 ?

To fool this you would need a zero length file created on the DOS zero
date under NT/W2K/XP.  I'm not sure you could easily get ffirst to return
a 3 character name even in this case (?)

I think this could be one additional if block around line 600 in lstat.c.

- Raw text -


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