Mail Archives: djgpp-workers/2002/01/08/10:07:30
>
>
> 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 -