-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mmap_array fails for empty file (0-length array) #10516
Comments
The current behavior is an explicit check that the file size is > 0 or an ArgumentError is thrown. I guess I can see the argument that we should return a 0-length array. Do people think that would generally be a better behavior? |
Since 0-length arrays are valid, I think it would be better to support any length |
Allow 0-length arrays to be returned from Mmap.mmap. Fixes #10516
Sorry to raise an old issue. I just encountered the following:
I would expect the second call to return a Line 196 in 5faad5f
It looks like this could be an oversight, and that line could just be replaced with:
What do you think? |
Yes, that seems like an oversight in d208f8d, and would make a good PR. On an unrelated note, it seems like the |
mmap_array(Int, (0,), open("foo", "r"))
on an empty file"foo"
gives:(See also JuliaIO/JSON.jl#98.)
The text was updated successfully, but these errors were encountered: