Why does (stat() ?) open files ?

Corinna Vinschen corinna-cygwin@cygwin.com
Mon Apr 9 13:09:00 GMT 2018


On Apr  9 14:12, Ben RUBSON wrote:
> On 09 Apr 2018 12:52, Corinna Vinschen wrote:
> > It's nice that you're testing all this, but you should ask *why* Cygwin
> > does it in the first place.  The reason is that the information one can
> > gather without opening the file on Windows is insufficient to fill in
> > all of the stat struct.  The directory info returned by
> > NtQueryDirectoryFile just isn't, thus it's only a fallback.
> 
> Corinna, thank you very much for your answer.
> What info would be missing without opening the file ?
> 
> Do you know where the open call could come from, when only using
> NtQueryDirectoryFile in symlink_info::check() ?
> (certainly related to the previous question)

NtQueryDirectoryFile requires an open directory handle of course.
NtOpenFile on the dir is called a few lines prior to NtQueryDirectoryFile.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-developers/attachments/20180409/5fb447ba/attachment.sig>


More information about the Cygwin-developers mailing list