Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Mon, 6 Jun 2005 14:13:53 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: performance problems Message-ID: <20050606121353.GH3268@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <4297A14B DOT 9070409 AT plausible DOT org> <20050528131501 DOT V53507 AT logout DOT sh DOT cvut DOT cz> <20050528160424 DOT GB12395 AT trixie DOT casa DOT cgf DOT cx> <429ED094 DOT 9080001 AT tlinx DOT org> <429FAA40 DOT 1050707 AT tlinx DOT org> <429FB310 DOT F17D2674 AT dessent DOT net> <20050606093101 DOT GD3268 AT calimero DOT vinschen DOT de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050606093101.GD3268@calimero.vinschen.de> User-Agent: Mutt/1.4.2i On Jun 6 11:31, Corinna Vinschen wrote: > On Jun 2 18:32, Brian Dessent wrote: > > In order to implement stat(), cygwin has to call NtQueryInformationFile > > (GetFileInformationByHandle for 9x/me) and this requires the file to be > > opened. Thus the reason that stat takes forever is that each file has > > There would be a theoretical way around this. NtQueryDirectoryFile allows > to get all information about a file (with a prominent exception) without > having to open the file. Instead you just need the handle to the parent > directory. We don't have the infrastructure in Cygwin right now to use > this method easily, but it could speed up stat when, for instance, the file > is in the current working directory or if the process has called opendir on > the parent directory of the file. Further testing of the NtQueryDirectoryFile function shows that it's not usable as I imagined. If you want to retrieve information about a single file without disturbing the current opendir/readdir, it's necessary to open the directory again. The directory handle used in the current opendir/readdir is not usable for this purpose. Neither is a duplicated handle of it. Oh boy. Looks like the only useful way to use it is caching the results. As far as that's useful. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader mailto:cygwin AT cygwin DOT com Red Hat, Inc. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/