Question
Platform‑dependent visibility of external edits in numpy.memmap mode='r+'
Cig Nea
0 reputation · 09 Aug 2025, 07:18 UTC
103.7K views0
Goal
Determine whether modifications made to the backing file of a numpy.memmap opened with mode='r+' are reflected in the in‑memory array across different operating systems.
Uncertainty
The NumPy documentation notes that memmap supports lazy loading and that mode='r+' allows read/write access, but it does not explicitly state how external changes to the file are handled. Reports suggest that behavior may differ between Windows and Linux, yet no definitive reference exists.
Questions
- Which platforms reliably detect external modifications to a
memmapfile opened withmode='r+'? - Does the timing of reads after an external write influence whether the changes are visible?
- What mechanisms, if any, can be employed to guarantee that the memmap view stays in sync with the underlying file?