digitalmars.D - std.MmFile.Mode.readCopyOnWrite documentation/implementation
- Bastiaan Veelo (15/16) Jun 03 2019 When I test that on Windows, what seems to happen is that when
- Jonathan Marler (4/20) Jun 03 2019 It's funny because the name of the enum makes more sense than the
Currently[1], std.MmFile.Mode.readCopyOnWrite is documented asreadCopyOnWrite, /// Read/Write existing file, copy on writeWhen I test that on Windows, what seems to happen is that when written to, memory is copied and the copy is no longer backed by a file. So changes are not persistent and I think this should be clarified in the documentation. This mode will not change the file, and Read/Write should actually be Read, I would think. But marking the file read-only will cause this to fail, as the file is actually opened Read/Write in the implementation, and I wonder whether it should be opened read-only instead. The implementation is platform-specific, so what works on one might not work on the other. Any input on this? Bastiaan. [1] https://github.com/dlang/phobos/blob/841541fca9c8c0224f3d47ef11db219a9fa5e065/std/mmfile.d#L64
Jun 03 2019
On Monday, 3 June 2019 at 09:11:41 UTC, Bastiaan Veelo wrote:Currently[1], std.MmFile.Mode.readCopyOnWrite is documented asIt's funny because the name of the enum makes more sense than the comment :) readCopyOnWrite is pretty clear, but "Read/Write existing file, copy on write" is a bit confusing.readCopyOnWrite, /// Read/Write existing file, copy on writeWhen I test that on Windows, what seems to happen is that when written to, memory is copied and the copy is no longer backed by a file. So changes are not persistent and I think this should be clarified in the documentation. This mode will not change the file, and Read/Write should actually be Read, I would think. But marking the file read-only will cause this to fail, as the file is actually opened Read/Write in the implementation, and I wonder whether it should be opened read-only instead. The implementation is platform-specific, so what works on one might not work on the other. Any input on this? Bastiaan. [1] https://github.com/dlang/phobos/blob/841541fca9c8c0224f3d47ef11db219a9fa5e065/std/mmfile.d#L64
Jun 03 2019