Bug 102888 - Diablo 1.5.0 throws FileNotFoundException when opening files in rws mode
Summary: Diablo 1.5.0 throws FileNotFoundException when opening files in rws mode
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: java (show other bugs)
Version: 6.1-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: Greg Lewis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-05 08:10 UTC by Knut Anders Hatlen
Modified: 2011-03-06 20:53 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Knut Anders Hatlen 2006-09-05 08:10:24 UTC
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");
Comment 1 Greg Lewis freebsd_committer freebsd_triage 2006-09-07 17:32:39 UTC
Responsible Changed
From-To: freebsd-java->glewis

I'll take it.
Comment 2 Greg Lewis 2006-09-07 20:45:27 UTC
*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
Comment 3 Knut Anders Hatlen 2010-09-29 17:51:57 UTC
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
Comment 4 Eitan Adler freebsd_committer freebsd_triage 2011-03-06 20:53:36 UTC
State Changed
From-To: open->closed

submitter says this is not a problem any more