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: from "Eli Zaretskii" at Jan 06, 2002 03:56:08 PM X-Mailer: ELM [version 2.5 PL2] Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 Precedence: bulk > 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.