Mailing-List: contact cygwin-developers-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT cygwin DOT com Delivered-To: mailing list cygwin-developers AT cygwin DOT com Date: Mon, 27 May 2002 22:18:16 -0400 From: Christopher Faylor To: cygwin-patches AT cygwin DOT com Cc: cygwin-developers AT cygwin DOT com Subject: New stat stuff (was [PATCH] improve performance of stat() operations (e.g. ls -lR )) Message-ID: <20020528021816.GA2066@redhat.com> Reply-To: cygwin-patches AT cygwin DOT com Mail-Followup-To: cygwin-patches AT cygwin DOT com, cygwin-developers AT cygwin DOT com References: <20020527011013 DOT GA15710 AT redhat DOT com> <024701c2051d$e13cbdc0$6132bc3e AT BABEL> <20020527022339 DOT GA15585 AT redhat DOT com> <20020527142437 DOT A26046 AT cygbert DOT vinschen DOT de> <20020527174354 DOT GB21314 AT redhat DOT com> <20020527203832 DOT A27852 AT cygbert DOT vinschen DOT de> <20020527184452 DOT GA21106 AT redhat DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020527184452.GA21106@redhat.com> User-Agent: Mutt/1.3.23.1i On Mon, May 27, 2002 at 02:44:52PM -0400, Christopher Faylor wrote: >On Mon, May 27, 2002 at 08:38:32PM +0200, Corinna Vinschen wrote: >>On Mon, May 27, 2002 at 01:43:54PM -0400, Chris Faylor wrote: >>> In the process of researching this, I discovered that NT has a mechanism >>> for determining a filename from an open handle so I'm trying to work >>> that into dtable.cc. >> >>Interesting. Could you provide some link? MSDN or so? > >It's in the Native API reference. NtQueryObject or NtQueryInformationFile. >I had something working nicely with NtQueryInformationFile but then found out >that it wasn't actually returning drive info. So, the common google wisdom >was that NtQueryObject should be used instead. I assume that will probably >return something like \device\whatever\dir\foo, though. > >The Windows 9x stuff mentions the use of VXDs although there is a hint that >maybe that's not necessary. I've just checked in a cleanup of fhandler_disk_file::fstat which attempts to avoid opening the file, where possible. Instead, it uses the already existing FindFirstFile logic. When it is necessary for the file to be opened, in theory, it attempts to do so in query_open mode if it already knows the file's executable state. So, given the original reason for the patch that started this thread, the -X and -E options should have a much greater impact on performance. I also added an NT-specific routine to determine the file name from it's handle. That means the binmode/textmode mounts should work correctly when redirecting files on the console in Windows NT. My quest to find functions for doing this on Windows 9x continues. A snapshot is building now. FYI, cgf