This is the mail archive of the
mailing list for the Cygwin project.
Re: [PATCH] improve performance of stat() operations (e.g. ls -lR )
On Mon, May 27, 2002 at 02:29:00AM +0100, Conrad Scott wrote:
>"Christopher Faylor" <firstname.lastname@example.org> wrote:
>>Hmm. Interesting. It seems like -E and -X should just be defaulting
>>to doing query_open. I think that the only reason that query_open is
>>not the default is that the file has to be opened for reading if the
>>executable state is not known.
>>Or, maybe it's actually possible not to do an open at all in those
>A (possibly related) note, it occurred to me the other day (as I looked
>at some strace output) that opening the file during stat() --- so that
>you can call GetFileInformationByHandle() --- will be slow if you've
>got an anti-virus program running since they tend to intercept file
>opens. Then again, I don't understand enough about cygwin *or* win32
>to understand whether you can get the same information without opening
>the file. Thus it might be a win to avoid opening the file if possible
>on ntsf too (w/ ntsec).
Yeah, that's why I was thinking that an open wasn't necessary.
Unfortunately, it seems like it is.
You can get nearly all of the information that you need from
FindFirstFile. Unfortunately, GetFileInformationByHandle() seems to be
the only available function which returns the hard link count of a file.