With Diablo 1.5.0_07-b00, opening an existing file in rws mode causes a FileNotFoundException with message text "file exists". This does not happen on Solaris or Linux, nor does it happen on FreeBSD with jvm version 1.4.2-p8. Opening files in rw mode or rwd mode does not cause any problem. Opening nonexistent files in rws mode also works fine. How-To-Repeat: Run a java application which executes the following code (or similar): File tmp = File.createTempFile("xxx", null); RandomAccessFile raf = new RandomAccessFile(tmp, "rws");
Responsible Changed From-To: freebsd-java->glewis I'll take it.
*sigh* I fixed this two years ago in JDK 1.4: 2004-07-21 Wednesday 17:58 glewis * j2se/src/share/native/java/io/io_util.h: . At least on FreeBSD, O_SYNC and O_DSYNC aren't both defined (for FreeBSD 4.x neither are defined and for FreeBSD 5.x O_DSYNC isn't defined). This caused them to be defined to some bogus values. In particular, O_SYNC would be defined as 0x800, which is O_EXCL (at least on FreeBSD 4.x). The result being that the RandomAccessFile class would fail to open an existing file if you specified "s" as part of the mode. Fix this by defining O_SYNC and O_DSYNC to O_FSYNC on BSD if they aren't defined. This shouldn't hurt Net or Open. Looks like we neglected to forward port this fix to 1.5 :(. -- Greg Lewis Email : glewis@eyesbeyond.com Eyes Beyond Web : http://www.eyesbeyond.com Information Technology FreeBSD : glewis@FreeBSD.org
This does not seem to be a problem in Diablo 1.6.0-7, so I think the bug can be closed now. Thanks, -- Knut Anders
State Changed From-To: open->closed submitter says this is not a problem any more