]> Cypherpunks repositories - gostls13.git/commit
os: avoid GetFileInformationByHandleEx call when stat'ing files on Windows
authorqmuntal <quimmuntal@gmail.com>
Fri, 23 Feb 2024 13:01:34 +0000 (14:01 +0100)
committerQuim Muntal <quimmuntal@gmail.com>
Tue, 27 Feb 2024 16:41:24 +0000 (16:41 +0000)
commit49319ed5c7aa6de6dd4313887dc1494ae73439e2
treeeccabe18a31a2ec29a25dc3bb3c7dc804262bc5e
parentf7777688ca19584ed7c278431560f6a545822370
os: avoid GetFileInformationByHandleEx call when stat'ing files on Windows

os.Stat and os.Lstat on Windows use GetFileInformationByHandleEx to
retrieve file information for reparse points and files that
GetFileAttributesEx does not handle.

However, GetFileInformationByHandleEx is only necessary for
reparse points, so we can avoid the call for regular files.

With this change we can drop the FAT hack that was added in CL 154377,
as files won't have the FILE_ATTRIBUTE_REPARSE_POINT attribute set
on that file system.

Change-Id: Id18639067a6c3fa1bb2c6706d5b79358c224fe37
Reviewed-on: https://go-review.googlesource.com/c/go/+/566397
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
src/os/types_windows.go