JuliaIO / JLD.jl

Saving and loading julia variables while preserving native types
MIT License
278 stars 55 forks source link

`jldwrite` convenience function #203

Open carstenbauer opened 6 years ago

carstenbauer commented 6 years ago

Why is there no jldwrite("test.jld", "y", rand(2,2)) convenience function?

using JLD

# create dummy file
save("test.jld", "x", rand(2,2))

# I now want to add another element to "test.jld"
# I can't do save("test.jld", "y", rand(2,2)) because
# this creates a new file that only contains y (x is lost).

# Of course I can do:
jldopen("asd.jld", "r+") do f
  write(f, "y", rand(2,2))
end

For HDF5 I would just do h5write("test.jld", "y", rand(2,2)).

Why is there no jldwrite("test.jld", "y", rand(2,2)) convenience function?

At least I couldn't find it anywhere.

carstenbauer commented 6 years ago

x-ref: https://discourse.julialang.org/t/h5write-analog-for-jld/7917