[9] RFC on 8073061: Files.copy(foo, bar, REPLACE_EXISTING) deletes bar even if foo is not readable
Alan Bateman
Alan.Bateman at oracle.com
Wed Feb 18 08:17:39 UTC 2015
On 18/02/2015 08:13, Francis Galiegue wrote:
> This was not what I was talking about.
>
> From your mail I understood that the destination file would have to be
> opened(O_TRUNC) _even if the source file is not readable_. Which is
> not any better than the current behavior, really. In fact it's even
> worse.
>
> Or did I misread?
>
For regular file case and assuming no sym links the implementation is
supposed to open the source and then open the destination with O_TRUNC.
In general, there is a big matrix of scenario and the tests for these
methods attempt to create as many of these scenarios as possible.
-Alan
More information about the nio-dev
mailing list