Skip to content

Commit

Permalink
Fix #440 h5write/read with filename (#441)
Browse files Browse the repository at this point in the history
  • Loading branch information
una-dinosauria authored and musm committed Aug 18, 2017
1 parent e909299 commit 99c9718
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/HDF5.jl
Expand Up @@ -679,7 +679,7 @@ function h5rewrite(f::Function, filename::AbstractString, args...)
end

function h5write(filename, name::String, data)
fid = h5open(filename, "r+")
fid = h5open(filename, true, true, true, false, true)
try
write(fid, name, data)
finally
Expand Down
8 changes: 8 additions & 0 deletions test/plain.jl
Expand Up @@ -345,4 +345,12 @@ f = h5open(fn, "w")
close(f)
rm(fn)

# Test the h5read/write interface with a filename as a first argument, when
# the file does not exist
h5write(fn, "newgroup/W", W)
Wr = h5read(fn, "newgroup/W")
@test Wr == W
close(f)
rm(fn)

end # testset plain

0 comments on commit 99c9718

Please sign in to comment.