RFR: 8073061: (fs) Files.copy(foo, bar, REPLACE_EXISTING) deletes bar even if foo is not readable [v3]

Alan Bateman alanb at openjdk.org
Thu Sep 7 16:07:42 UTC 2023


On Tue, 5 Sep 2023 17:05:29 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Check that the source is readable before deleting the destination.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8073061: Address reviewer comments

src/java.base/unix/classes/sun/nio/fs/UnixFileSystem.java line 1050:

> 1048:             else if (!sourceAttrs.isSymbolicLink() || flags.followLinks) {
> 1049:                 // ensure source can be moved
> 1050:                 try {

This is copy rather than move but I think R_OK is correct, at least for regular files.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15501#discussion_r1318827863


More information about the nio-dev mailing list