Why does (stat() ?) open files ?
Ben RUBSON
ben.rubson@gmail.com
Tue Apr 10 14:11:00 GMT 2018
On 09 Apr 2018 15:09, Corinna Vinschen wrote:
> 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.
Yes I agree, but the open call I'm talking about is made on every file, not
only on the containing directory.
I wonder if another function later in the code path would re-open every
file, due to some missing information non-provided by symlink_info::check()
without its NtCreateFile/NtOpenFile calls.
Ben
More information about the Cygwin-developers
mailing list