Wrong exception thrown?

Alan Bateman Alan.Bateman at Sun.COM
Tue Sep 1 07:00:45 PDT 2009

Mark Thornton wrote:
> Surely that is also subject to potential races --- another process 
> could change the FileStore associated with a path.
Yes, this can happen. Same for this:

if (target.notExist())
  source.moveTo(target, ATOMIC_MOVE);

It would be desirable if ATOMIC_MOVE could guarantee not to replace an 
existing file but that may not be feasible everywhere (esp. 
implementations with rename).


More information about the nio-dev mailing list