]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.25] os: support deleting read-only files in RemoveAll on older...
authorqmuntal <quimmuntal@gmail.com>
Tue, 21 Oct 2025 14:14:03 +0000 (16:14 +0200)
committerGopher Robot <gobot@golang.org>
Tue, 28 Oct 2025 20:58:08 +0000 (13:58 -0700)
commit8097b1915f617167f3b12b03e78a23859d256eb6
treec643e42d2e9fa5601543f07b19d33694d48d2829
parent4942c74d04295c72e293b4a67200513b9a36f99d
[release-branch.go1.25] 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.

For #75922
Fixes #75989

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>
(cherry picked from commit b31dc77ceab962c0f4f5e4a9fc5e1a403fbd2d7c)
Reviewed-on: https://go-review.googlesource.com/c/go/+/715360
Auto-Submit: Michael Knyszek <mknyszek@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