2 ms·
On Windows Rust calls out to `CreateFileW`[0], and by default uses the `FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE` share permission[1]. [0] https:
by Measter 6y ago
On Windows Rust calls out to `CreateFileW`[0], and by default uses the `FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE` share permission[1].
[0] https://github.com/rust-lang/rust/blob/master/library/std/src/sys/windows/fs.rs#L282-L300 https://github.com/rust-lang/rust/blob/master/library/std/sr...
[1] https://doc.rust-lang.org/std/os/windows/fs/trait.OpenOptionsExt.html#tymethod.share_mode https://doc.rust-lang.org/std/os/windows/fs/trait.OpenOption...
- optimiz3 6y agoThat's a design difference from C++ then, however even if the file is deleted the delete on Windows doesn't persist for existing open handles until the file is closed.