Files

HDF5.h5openFunction
h5open(filename::AbstractString, mode::AbstractString="r"; swmr=false, pv...)

Open or create an HDF5 file where mode is one of:

  • "r" read only
  • "r+" read and write
  • "cw" read and write, create file if not existing, do not truncate
  • "w" read and write, create a new file (destroys any existing contents)

Pass swmr=true to enable (Single Writer Multiple Reader) SWMR write access for "w" and "r+", or SWMR read access for "r".

Properties can be specified as keywords for FileAccessProperties and FileCreateProperties.

Also the keywords fapl and fcpl can be used to provide default instances of these property lists. Property lists passed in via keyword will be closed. This is useful to set properties not currently defined by HDF5.jl.

Note that h5open uses fclose_degree = :strong by default, but this can be overriden by the fapl keyword.

source
h5open(f::Function, args...; pv...)

Apply the function f to the result of h5open(args...; kwargs...) and close the resulting HDF5.File upon completion. For example with a do block:

h5open("foo.h5","w") do h5
    h5["foo"]=[1,2,3]
end
source
h5open(file_image::Vector{UInt8}, mode::AbstractString="r";
    name=nothing,
    fapl=FileAccessProperties(),
    increment=8192,
    backing_store=false,
    write_tracking=false,
    page_size=524288,
    pv...
)

Open a file image contained in a Vector{UInt8}. See API.h5p_set_file_image.

Unlike Drivers.Core the default here is not to use a backing store.

source
HDF5.ishdf5Function
ishdf5(name::AbstractString)

Returns true if the file specified by name is in the HDF5 format, and false otherwise.

source
Base.isopenFunction

isopen(obj::HDF5.File)

Returns true if obj has not been closed, false if it has been closed.

source
Base.readFunction
read(parent::H5DataStore)
read(parent::H5DataStore, names...)

Read a list of variables, read(parent, "A", "B", "x", ...). If no variables are specified, read every variable in the file.

source
read(parent::Union{HDF5.File, HDF5.Group}, name::AbstractString; pv...)
read(parent::Union{HDF5.File, HDF5.Group}, name::AbstractString => dt::HDF5.Datatype; pv...)

Read a dataset or attribute from a HDF5 file of group identified by name. Optionally, specify the HDF5.Datatype to be read.

source
read(obj::HDF5.DatasetOrAttribute}

Read the data within a HDF5.Dataset or HDF5.Attribute.

source