Let’s say I saved a dataset named “dataset” to “file.jld2”:
using JLD2, Random
jldopen("file.jld2", "w") do fd
fd["dataset"] = [randn(100,100) for i=1:100]
end
Now, I want to alter one of the entries in the dataset:
jldopen("file.jld2", "a") do fd
ds = fd["dataset"]
ds[1] = randn(100,100)
end
- When is the actual write to the file triggered in the last case? When I do the assignment
ds[1] = randn(100,100)
? Or when the file is closed? - Does it depend on the memory size of the element I am trying to write? I mean, smaller or larger than buffer.