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 11:31:01 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: performance problems Message-ID: <20050606093101.GD3268@calimero.vinschen.de> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <429FB310.F17D2674@dessent.net> User-Agent: Mutt/1.4.2i 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. I'm not sure, but it could perhaps even get rid of the annoying messages ls: hiberfil.sys: No such file or directory ls: pagefile.sys: No such file or directory when calling `ls -l' in /cygdrive/c. Uh, yes, the prominent exception... unfortunately, there's no way to use NtQueryDirectoryFile on NT4 and W2K to retrieve the file id (inode number). This has been introduced with XP and 2K3 first. Too bad. 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/