Looking at the constructor of RandomAccessFile for the mode it says ‘rws’ The file is opened for reading and writing. Every change of the file's content or metadata must be written synchronously to the target device.
Does this imply that the mode ‘rw’ is asynchronous? Do I need to include the ‘s’ if I need to know when the file write is complete?
The synchronous / asynchronous distinction refers to the guarantee that the data / metadata has been safely to disk before the
writecall returns. Without the guarantee of synchronous mode, it is possible that the data that you wrote may still only be in memory at the point that thewritesystem call completes. (The data will be written to disk eventually … typically within a few seconds … unless the operating system crashes or the machine dies due to a power failure or some such.)Synchronous mode output is (obviously) slower that asynchronous mode output.
Yes, it is, in the sense above.
Yes, if by “complete” you mean “written to disc”.