RFR: 8073061: (fs) Files.copy(foo, bar, REPLACE_EXISTING) deletes bar even if foo is not readable [v6]
Brian Burkhalter
bpb at openjdk.org
Mon Sep 18 17:16:34 UTC 2023
On Mon, 18 Sep 2023 07:37:46 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>>
>> 8073061: Tweak CopyMoveHelper.copyToForeignTarget
>
> src/java.base/unix/classes/sun/nio/fs/UnixFileSystem.java line 901:
>
>> 899: // ensure source can be moved
>> 900: try {
>> 901: access(source, W_OK);
>
> One small suggestion here is to move this to L900, after UnixFileAttributes.get, as that will avoid the exception handling and means the examination of the source is in one place.
Good idea. So changed in cd644e46fed22a1f8b4932b8ee5b54626134ad18.
> test/jdk/java/nio/file/Files/CopyMoveVariations.java line 129:
>
>> 127: }
>> 128:
>> 129: if (Files.getFileStore(source).supportsFileAttributeView("posix")) {
>
> The `@requires` at the top of the test restricts execution to Linux and macOS for now. I would have thought it's a hard requirement that the file system support POSIX file permissions.
Moved requirement to top level in cd644e46fed22a1f8b4932b8ee5b54626134ad18. The `@requires` remains as-is.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15501#discussion_r1329048318
PR Review Comment: https://git.openjdk.org/jdk/pull/15501#discussion_r1329048004
More information about the nio-dev
mailing list