RFR: 8293122: (fs) Use file cloning in macOS version of Files::copy method [v4]

Brian Burkhalter bpb at openjdk.org
Tue Sep 13 16:27:56 UTC 2022


On Tue, 13 Sep 2022 11:05:56 GMT, Alan Bateman <alanb at openjdk.org> wrote:

> The only issue is that someone might become dependent on this and then be surprised when they code behaves differently when run on another platform.

This is a good reason to leave it as-is.

> I'm curious if there is a way to test how clone behaves when it fails. What you have is okay although the unlink might only be needed when chown fails.

All the described error numbers except EIO are things which one would expect the call to verify before actually starting to clone, so for those cases it would be unexpected to find that the destination exists after the failure. Provoking an EIO failure might be difficult.

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

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


More information about the nio-dev mailing list