commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Hartmann <ehartm...@sharedvalue.com>
Subject [VFS] Exception while copying FileObject
Date Wed, 07 Dec 2005 16:52:18 GMT
Hi,

With commons-vfs RC6, I experience sometimes the following exception :
Could not write to "file:///tmp/test/file3.txt" because it is read-only.

I found the cause of this exception, this happens when :
1. a file (file1.txt) is copied to a directory (/tmp/test/) containing 
the destination file (file3.txt)
2. another process (inside or outside the jvm) delete this directory 
(/tmp/test) and recreate it.
3. another file (file2.txt) is copied to the same directory (/tmp/test) 
with the same file name (file3.txt)

I've attached a small junit test showing this exception.
It seems that the object File pointing to file3.txt is maintained in 
LocalFile between step 1 and 3 but unfortunatelly at step3, this file 
pointer is no more valid.

I'm using  Sun JDK 1.4.2_10 on Linux Fedora Core 4.

-eric



Mime
View raw message