Mail Archives: djgpp-workers/2001/12/30/07:03:13
On Sat, 29 Dec 2001, Charles Sandmann wrote:
> > > Either modify or assume that no drive supports LFN API
> > > because the default drive does not support it and libc calls _use_lfn(0) to
> > > check for LFN API support
> > > Or I'm wrong there ?
> >
> > Some of the library functions do call _use_lfn with a non-NULL file
> > name argument.
>
> My understanding is that we should really have *all* calls to _use_lfn
> in the library be called with the file name we want to operate on
> (or at least the disk letter).
Not necessarily: in most cases, all we want to know is whether the OS
supports the LFN API, to decide which function of Int 21h to call. If
the LFN API is available, we always prefer it, even if the file name
is short or resides on a filesystem which annot store long names.
The precise level of LFN support for a given disk only matters to use
when we want to know, e.g., whether file names like foo.bar.exe are
possible (see dosexec.c, for example).
Also, we don't always have a file name to prob the LFN support on its
disk. One example is function 5704h called by utime, another is
function 71A6h called by fstat.
I think we need two separate functions for the two kinds of tests.
> > > > Since this applies to all programs, simply replacing _use_lfn with a
> > > > custom version will do what you want. So I don't see a reason to
> > > > invent an application-level feature like the one you suggest.
> > >
> > > It's easier to put a custom version of _use_lfn in a separate library
> > > than to modify libc itself.
> >
> > Perhaps; but that, too, does not require any handler, just a
> > replacement in a separate library.
>
> I don't understand the problem - I think we should fix libc to do the
> right thing instead of expecting an application to hook in and try to
> fix it?
Yes, I agree. That's what I was trying to say.
- Raw text -