From: "Laurynas Biveinis" Date: Wed, 23 May 2001 21:05:05 +0200 To: Eli Zaretskii 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 , 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 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 Precedence: bulk > 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