wood burning stoves 2.0
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes RandomAccessFile - which mode? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "RandomAccessFile - which mode?" Watch "RandomAccessFile - which mode?" New topic

RandomAccessFile - which mode?

Dan Murphy
Ranch Hand

Joined: Mar 29, 2005
Posts: 126

In my design I have multiple instances of Data, each of which uses a RandomAccessFile to read the database file. It seems to me that using RandomAccessFile mode "rws" (or "rwd") rather than "rw" will greatly simplify concurrent file access, when there are multiple instances of RandomAccessFile writing to the same file, because a client knows that as soon as a file-updating method has returned, other clients will be able to see the changes. But the consensus in this thread seems to be that "rw" is sufficient, can someone explain why?


I agree. Here's the link: http://aspose.com/file-tools
subject: RandomAccessFile - which mode?
It's not a secret anymore!