aspose file tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes RandomAccessFile - which mode? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Reply Bookmark "RandomAccessFile - which mode?" Watch "RandomAccessFile - which mode?" New topic
Author

RandomAccessFile - which mode?

Dan Murphy
Ranch Hand

Joined: Mar 29, 2005
Posts: 126
Hi,

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?

Cheers,
Dan


SCJP, SCJD, SCWCD
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: RandomAccessFile - which mode?
 
Similar Threads
NX: RandomAccessFile - "rw", "rwd"
Why FileOutputStream cann't create an empty file in following statement
Random Access File modes
Help me about RandomAccessFile
Using Random access file to write to a file with long absolute path take long time in unix