Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX: RandomAccessFile - "rw", "rwd"

 
Terry Martinson
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use the RandomAccessFile approach for io. I currently open the raf with mode "rwd". Here is the API info I find for the different modes:

"rw" Open for reading and writing. If the file does not already exist then an attempt will be made to create it.
"rws" Open for reading and writing, as with "rw", and also require that every update to the file's content or metadata be written synchronously to the underlying storage device.
"rwd" Open for reading and writing, as with "rw", and also require that every update to the file's content be written synchronously to the underlying storage device.

I have not worked a lot with RandomAccessFile and am wondering if one is suggested over the others. I did notice in the API description for the "rws" and "rwd" it mentions they may be more efficient.
Thoughts?
TJ
 
Jason Mowat
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had one issue with RW and RandomAccessFile:

Aside from that issue, I found RW to be quite sufficient.
Cheers,
Jason
 
Jacques Bosch
Ranch Hand
Posts: 319
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, good point.
I put the file.exist check in my launch dialog. It has to exist before the server will launch.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic