Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[stellation-res] File.renameTo()

This API is not safe to use on any platform. It will never succeed when a
move across file system boundaries is required (e.g. between a local file
system and NFS) and on Windows it will fail when trying to move a file from
one directory to another. The failure is reported, not by an exception, but
simply by returning "false".

One solution would be to use the Unix mv command, natively under Unix and
under Cygwin under Windows. Another, and I feel better solution, would be to
implement an internal method that provides the necessary subset of
functionality of the mv command.

Specifically this one bit me in TextArtifact.normalize(). It is nasty
because the workspace file simply disappears and later processing fails with
a FileNotFound exception because the workspace file is no longer present.



Back to the top