Mail Archives: djgpp-workers/2001/05/23/14:03:48
> From: "Laurynas Biveinis" <lauras AT softhome DOT net>
> Date: Wed, 23 May 2001 18:19:00 +0200
>
> > > This scenario in comment isn't the fastest one - the fastest
> > > way to check out for symlinkiness is __internal_readlink(),
> > > not *stat(). So if application really stat unknown files, I suggest
> > > doing __internal_readlink() here.
> >
> > I was thinking about GNU Fileutils, and they only use standard
> > functions.
>
> No, I meant that _library_ should do __internal_readlink, not fileutils.
You mean, you think readdir should call __internal_readlink to find
out if this is a symlink, and if so, to set d_type to DT_LNK?
If so, then this is exactly what I wanted to avoid: opening a file and
reading its first chunk will slow down readdir tremendously. It is
IMHO unreasonable to punish all programs which use readdir to such a
great extent.
The decision I made to set suspect symlinks to DT_UNKNOWN was based on
an assumption that on a typical DJGPP system, the number of symlinks
will be relatively small, so the version of `ls' that uses this
feature will still be significantly faster than without it.
- Raw text -