Skip to content

Commit a676a5c

Browse files
authored
Merge pull request #218 from alyst/rdata_v3
Support RData version 3 (default for R >= 3.5)
2 parents 471dde6 + 657c386 commit a676a5c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/registry.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ add_format(format"JLD", (unsafe_wrap(Vector{UInt8}, "Julia data file (HDF5), ver
66
add_format(format"JLD2", "Julia data file (HDF5), version 0.2", ".jld2", [:JLD2])
77
add_format(format"GZIP", [0x1f, 0x8b], ".gz", [:Libz])
88

9-
# test for RD?2 magic sequence at the beginning of R data input stream
9+
# test for RD?n magic sequence at the beginning of R data input stream
1010
function detect_rdata(io)
1111
seekstart(io)
1212
read(io, UInt8) == UInt8('R') &&
1313
read(io, UInt8) == UInt8('D') &&
1414
read(io, UInt8) in (UInt8('A'), UInt8('B'), UInt8('X')) &&
15-
read(io, UInt8) == UInt8('2') &&
15+
read(io, UInt8) in (UInt8('2'), UInt8('3')) &&
1616
(c = read(io, UInt8); c == UInt8('\n') || (c == UInt8('\r') && read(io, UInt8) == UInt8('\n')))
1717
end
1818

0 commit comments

Comments
 (0)