Skip to content

Commit

Permalink
Work around readuntil no longer including the delimiter
Browse files Browse the repository at this point in the history
  • Loading branch information
ararslan committed Jun 11, 2018
1 parent c1b33d2 commit ba1aa0a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/JLD2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,12 @@ openfile(::Type{IOStream}, fname, wr, create, truncate) =
openfile(::Type{MmapIO}, fname, wr, create, truncate) =
MmapIO(fname, wr, create, truncate)

read_bytestring(io::IOStream) = chop(String(readuntil(io, 0x00)))
if VERSION >= v"0.7.0-DEV.3510"
# The delimiter is excluded by default
read_bytestring(io::IOStream) = String(readuntil(io, 0x00))
else
read_bytestring(io::IOStream) = chop(String(readuntil(io, 0x00)))
end

const OPEN_FILES = Dict{String,WeakRef}()
function jldopen(fname::AbstractString, wr::Bool, create::Bool, truncate::Bool, iotype::T=MmapIO;
Expand Down

0 comments on commit ba1aa0a

Please sign in to comment.