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

Alan Bateman alanb at openjdk.org
Fri Sep 9 07:29:43 UTC 2022


On Thu, 8 Sep 2022 23:17:38 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Use BSD system call `clonefile` if possible when using `Files::copy` on macOS.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8293122: Revert BsdFileStore; move volume capability check to BsdNativeDispatcher

src/java.base/macosx/classes/sun/nio/fs/BsdFileSystem.java line 149:

> 147:                 } catch (UnixException x) {
> 148:                     if (flags.failIfUnableToCopyPosix)
> 149:                         x.rethrowAsIOException(target);

Can you compare this to the Unix implementation as I thought there was a best attempt to unlink when throwing an exception?

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

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


More information about the nio-dev mailing list