Date: Wed, 23 May 2001 20:32:42 +0300 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: "Laurynas Biveinis" Message-Id: <2110-Wed23May2001203241+0300-eliz@is.elta.co.il> X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.9 CC: djgpp-workers AT delorie DOT com In-reply-to: <20010523181900.A1817@lauras.lt> Subject: Re: Add d_type member to struct dirent References: <1659-Tue22May2001182402+0300-eliz AT is DOT elta DOT co DOT il> <20010522222711 DOT A2213 AT lauras DOT lt> <3405-Wed23May2001062932+0300-eliz AT is DOT elta DOT co DOT il> <20010523181900 DOT A1817 AT lauras DOT lt> Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > From: "Laurynas Biveinis" > 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.