-
Bug
-
Resolution: Won't Fix
-
P3
-
None
-
1.0.2, 1.1, 1.2.0
-
generic, sparc
-
generic, solaris_2.5
File.renameTo() has different semantics on Solaris and Win32.
This routine is a thin veneer over the rename() call in the C library.
On Win32, rename() is defined such that it is an error if the destination
file exists. On Solaris, the destination file can exist and rename()
has the affect of unlinking it.
We wrote code to update a file, where we write to a temporary file first and
then rename that file over the original. This is a pretty standard technique
to avoid losing the original data in the file. We use renameTo() as the final
step and this code fails on a Win32 platform.
This routine is a thin veneer over the rename() call in the C library.
On Win32, rename() is defined such that it is an error if the destination
file exists. On Solaris, the destination file can exist and rename()
has the affect of unlinking it.
We wrote code to update a file, where we write to a temporary file first and
then rename that file over the original. This is a pretty standard technique
to avoid losing the original data in the file. We use renameTo() as the final
step and this code fails on a Win32 platform.
- relates to
-
JDK-4167147 (spec) java.io.File.renameTo: Clarify spec wrt. system dependencies
-
- Resolved
-
-
JDK-4136096 Temp file doesn't work properly with File.renameTo() on Solaris
-
- Closed
-