RFR: 8355954: File.delete removes read-only files (win)

Brian Burkhalter bpb at openjdk.org
Wed Apr 30 23:41:58 UTC 2025


This change proposes to modify `java.io.File.delete()` so that regular files on Windows will not be deleted by default if their read-only attribute is set. A boolean-valued system compatibility property `jdk.io.File.deleteReadOnly` is defined to reinstate legacy behavior if desired.

-------------

Commit messages:
 - 8355954: File.delete removes read-only files (win)

Changes: https://git.openjdk.org/jdk/pull/24977/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24977&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8355954
  Stats: 153 lines in 4 files changed: 129 ins; 4 del; 20 mod
  Patch: https://git.openjdk.org/jdk/pull/24977.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24977/head:pull/24977

PR: https://git.openjdk.org/jdk/pull/24977


More information about the core-libs-dev mailing list