The RandomAccessFile
constructor accepts a mode
string specifying how a file should be open.
I'm confused about the difference between "rws"
and "rwd"
modes.
Here's what the docs state:
"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.
[...]
The "rwd" mode can be used to reduce the number of I/O operations performed. Using "rwd" only requires updates to the file's content to be written to storage; using "rws" requires updates to both the file's content and its metadata to be written, which generally requires at least one more low-level I/O operation.
...and no explanation about what metadata
means. Does it mean that "rws"
updates the last modified timestamp on the filesystem, and "rwd"
doesn't ?