You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia> using Mmap
julia> anon = Mmap.Anonymous()
Mmap.Anonymous("", false, true)
julia> Mmap.mmap(anon, Vector{UInt8}, (4,))
ERROR: MethodError: no method matching position(::Mmap.Anonymous)
Closest candidates are:
position(::Base.SecretBuffer) at secretbuffer.jl:154
position(::Base.Filesystem.File) at filesystem.jl:225
position(::Base.Libc.FILE) at libc.jl:101
...
Stacktrace:
[1] mmap(::Mmap.Anonymous, ::Type{Array{UInt8,1}}, ::Tuple{Int64}) at /build/julia/src/julia-1.1.0/usr/share/julia/stdlib/v1.1/Mmap/src/Mmap.jl:186
[2] top-level scope at none:0
julia> Mmap.mmap(anon, Vector{UInt8}, (4,), 0)
4-element Array{UInt8,1}:
0x00
0x00
0x00
0x00
I'd guess we should either implement position(::Mmap.Anonymous)=0 or change the default argument, like e.g.
function mmap(io::IO,
::Type{Array{T,N}}=Vector{UInt8},
dims::NTuple{N,Integer}=(div(filesize(io)-position(io),sizeof(T)),),
offset::Integer=(io isa Anonymous ? 0 : position(io)); grow::Bool=true, shared::Bool=true) where {T,N}
The text was updated successfully, but these errors were encountered:
Small convenience issue:
I'd guess we should either implement
position(::Mmap.Anonymous)=0
or change the default argument, like e.g.The text was updated successfully, but these errors were encountered: