Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

RandomAccessFile : What is rws and rwd mode?  RSS feed

 
Tanzy Akhtar
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi There,

Well i was going through the java docs for RandomAccessFile here.

In the description of constructor i could not differentiate the meaning of "rws" and "rwd" mode.

Basically what is the meaning of saying "written synchronously to the underlying storage device"?



Smile,
Tanzy.
 
r035198x
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As explained in the text the changes updated to the physical file before the I/O call returns if the file resides on the local device.
The difference between the two modes is that "rws" will write both changes to file contents and file metadata while "rwd" will update only on changes to file contents.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16028
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello "r035198x",

Welcome to JavaRanch. We have a naming policy here - we want users to use a real-sounding username, and not an obviously fake nickname.

Your username does not conform to the naming policy. Please read the policy carefully and change your display name, by editing your profile.

regards
Jesper Young
Bartender
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!