Mail Archives: djgpp-workers/2002/01/08/04:19:14
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.
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.
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.
- Raw text -