This is the mail archive of the
cygwin-developers@cygwin.com
mailing list for the Cygwin project.
Re: stat matters
- From: Christopher Faylor <cgf at redhat dot com>
- To: cygwin-developers at cygwin dot com
- Date: Wed, 28 May 2003 23:33:29 -0400
- Subject: Re: stat matters
- References: <3.0.5.32.20030527194843.008044b0@mail.attbi.com>
- Reply-to: cygwin-developers at cygwin dot com
On Tue, May 27, 2003 at 07:48:43PM -0400, Pierre A. Humblet wrote:
>Here are three remarks about stat
>
>1) Yesterday there was a discussion in cygwin_patches about the use of
>strlen()
> in fstat_by_name.
> The good news is that we can use strcmp(a, b) <= 0 after all, because in our
> case a is a prefix of b, or b is a prefix of a.
> The bad news is that one old bug still isn't taken care of: "c:/." is
> a root dir without being a prefix of "c:/".
> So I suggest a more radical approach: do not check for root dir at all but
> whenever FindFirstFile fails with winerror 2 (although we know the
> file did exist a few ms ago and we have its attributes), call fstat_helper
> with zero dates and lengths.
I guess this is the best approach. Want to work up a patch?
>2) There is a comment in fhandler_disk_file::fstat to the effect that a
> "query open" is much faster than a normal open.
> So, why don't we do a query open when possible, i.e. also for dirs, sockets,
> symlinks, and more importantly, whenever has_acls(), ntsec and
> wincap.has_security () are true?
This is supposed to be caught for anything which opens a file like
sockets or symlinks. The other cases are not caught, though. I'll add
something to path.cc to handle this.
cgf