Is there any reasons to not use "mmap" to read files?

rempas rempas at tutanota.com
Sun Feb 13 20:22:39 UTC 2022


On Sunday, 13 February 2022 at 12:55:43 UTC, Florian Weimer wrote:
> One issue that hasn't been mentioned so far is that if the 
> input file is truncated, accessing is memory-mapped view 
> results in `SIGBUS` on Linux and other systems. (I think 
> Windows prevents truncation instead.)
>
> In theory, it is possible to intercept that signal and turn it 
> into something else (Java does that), but I don't think the [D 
> implementation](https://github.com/dlang/phobos/blob/master/std/mmfile.d) does that.

Thank you for the info! That's very important and I'll keep in in 
mind!


More information about the Digitalmars-d mailing list