delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/05/23/15:26:42

From: "Laurynas Biveinis" <lauras AT softhome DOT net>
Date: Wed, 23 May 2001 21:05:05 +0200
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Cc: djgpp-workers AT delorie DOT com
Subject: Re: Add d_type member to struct dirent
Message-ID: <20010523210505.A478@lauras.lt>
Mail-Followup-To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>,
djgpp-workers AT delorie DOT com
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> <2110-Wed23May2001203241+0300-eliz AT is DOT elta DOT co DOT il>
Mime-Version: 1.0
User-Agent: Mutt/1.3.15i
In-Reply-To: <2110-Wed23May2001203241+0300-eliz@is.elta.co.il>; from eliz@is.elta.co.il on Wed, May 23, 2001 at 08:32:42PM +0300
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

> 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?

Yes...

> 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.

...but in 99.9% cases __internal_readlink() will call just filelength()
to check for 510 bytes magic size. No open() at all in this case, and plain
filelength() is cheaper that stat(), isn't it? Files of 510 bytes and not 
symlinks are rare indeed. Let's see - my whole djgpp subdirectory tree takes
about several hundred megabytes and has ONE such file out of 20205. (Not 
counting symlink testsuite, of course).

Laurynas

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019