Closed infeo closed 5 years ago
Because in zwCreateFile() the caller expects that the error codes are true to this point in time this is not a valid approach:
Imagine if someone opens a file with CREATE_NEW
flag, but the actual file channel is opened later. In the meantime another process could have already created the file and thus for the first process this would lead to an error.
Dokany-nio-adapter version: 1.1.4
Currently a file channel is always openend when a handle to a file is created, even when the file channel is not used until the closeFile() call.
This can be improved by switching from opening file channels preemptive to only when a real readFile() or writeFile() call is made.