From ba1aa0a3899c3d30f4cce571c862b142eb4b62d4 Mon Sep 17 00:00:00 2001 From: Alex Arslan Date: Sun, 10 Jun 2018 23:41:24 -0700 Subject: [PATCH] Work around readuntil no longer including the delimiter --- src/JLD2.jl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/JLD2.jl b/src/JLD2.jl index 41762e0e..3e40af3b 100644 --- a/src/JLD2.jl +++ b/src/JLD2.jl @@ -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;