I am using mmaped arrays, and sometimes they are opened as read-only.
i’d like to know, at run-time, whether an array is read-only, and if so make a copy so I can have a temporary modifiable version of it. Is there a function in julia to check ‘read-onlyness’, or if it can be written to? I can catch a read-only exception but I thought that maybe there was a better alternative.
So, you could implement isreadonly(a::Array) if there is some way to detect whether pointer(a) is in a protected page. (I suppose you could try writing a byte and catching a segfault; I don’t know if there is a better way.)