]> Cypherpunks repositories - gostls13.git/commit
os: support deleting read-only files in RemoveAll on older Windows versions
authorqmuntal <quimmuntal@gmail.com>
Tue, 21 Oct 2025 14:14:03 +0000 (16:14 +0200)
committerGopher Robot <gobot@golang.org>
Tue, 21 Oct 2025 15:45:19 +0000 (08:45 -0700)
commitb31dc77ceab962c0f4f5e4a9fc5e1a403fbd2d7c
tree97656db1b9df385442a3f041e5f2205b9a6d7495
parent46cc53290003340877413b8a53511b4f3685d213
os: support deleting read-only files in RemoveAll on older Windows versions

The Windows implementation of RemoveAll supports deleting read-only
files only on file systems that supports POSIX semantics and on
newer Windows versions (Windows 10 RS5 and latter).

For all the other cases, the read-only bit was not clearer before
deleting read-only files, so they fail to delete.

Note that this case was supported prior to CL 75922, which landed on
Go 1.25.

Fixes #75922

Change-Id: Id6e6477f42e1952d08318ca3e4ab7c1648969f66
Reviewed-on: https://go-review.googlesource.com/c/go/+/713480
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
src/internal/syscall/windows/at_windows.go
src/internal/syscall/windows/symlink_windows.go
src/internal/syscall/windows/syscall_windows.go
src/internal/syscall/windows/types_windows.go
src/internal/syscall/windows/zsyscall_windows.go
src/os/path_windows_test.go