Mail Archives: djgpp-workers/2002/01/08/01:12:47
> 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 -