3 ms·
Besides the issues that others have mentioned (typing, storing nested data-structures, pointers), you would add a requirement on the backing OS and file system
by Findecanor 4y ago
Besides the issues that others have mentioned (typing, storing nested data-structures, pointers), you would add a requirement on the backing OS and file system to enforce Mandatory File Locking.
While Windows enforces it, most Unix systems don't support it at all. Back when Linux had it (removed in 2021), it had to be enabled when a volume was mounted, and that was not default nor was it supported for all file system types.
Without it, even if you mmap() the file with the MAP_PRIVATE flag, portions of the file could be overwritten by other programs before you read them.