Closed infeo closed 4 years ago
There exists a dedicated file flag for synchronous writing:
FILE_WRITE_THROUGH | System services, file-system drivers, and drivers that write data to the file must actually transfer the data to the file before any requested write operation is considered complete.
Additionally the description provided by the documentation can be seen as that the Dokany driver cannot cache the file. This thought leads to the conclusion that the filesystem used by this adapter needs to decide to cache it or not.
The conclusion is that the file flag FILE_NO_INTERMEDIATE_BUFFERUNG
will be ignored.
The zwCreateFileFunction() is the first function called for any file/directory operation. You can hand over several flags with the parameters, one of them is
FILE_NO_INTERMEDIATE_BUFFERING
part of theCreateOptions
.The windows documentation describes the purpose of this flag the following:
Currently, when this flag is set, we handle write operations to the opened file as direct IO, leading to a very low write speed.
But this might be overcautiously. Taking this article about buffering from Microsoft into consideration, we do not pay any attention on buffer alignment, this is done by the JVM/System again.
Therefore we should thoroughly test ignoring this flag and then decide what to do.