Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.1.0 - English

Change language to:
Français - 日本語 - Português - Русский

Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function

Scilab Help >> HDF5 files > h5open

h5open

Open an HDF5 file

Syntax

obj = h5open(filename [, access])
obj = h5open(filename, access, driver [, driver_options...])

Arguments

filename

a string giving the filename

access

A string giving the access mode to use

driver

A string giving the driver name

driver_options

A boolean or a double depending of the driver value

obj

A H5Object corresponding to the open file

Description

Open an HDF5 file in using the access mode (by default "a").

The access mode is one of the five values:

  • "r": read only, the file must exist.
  • "r+": read/write, the file must exist.
  • "w": create file, truncate if exists.
  • "w-": create file, fail if exists.
  • "a": read/write if exists, create otherwise (default).

Several drivers can be used:

  • "sec2": Unbuffered, using standard POSIX functions.
  • "stdio": Uses functions from the standard C stdio.h to perform I/O.
  • "core": Uses a file in memory (improves read/write). This driver has two options:
    • backingStore: a boolean, if %T (default), the changes are saved in the real file.
    • blockSize: a double: increment (in bytes) to use to increase buffer size (default 64K).
  • "family": Allow to split the file when its size is greater than the option memberSize (a double, by default 2^31 -1). The filename must contain a %d which will be used to generate the family filenames.

Examples

x = 1:10;
save(TMPDIR + "/x.sod", "x"); // SOD files are HDF5 ones

// Open the created file
a = h5open(TMPDIR + "/x.sod");

// Dump the file content
h5dump(a);

// list the contents of the root element.
h5ls(a)

// Get the SOD version
a.root.SCILAB_sod_version.data

// or if the name contains 'invalid' chars
a.root("SCILAB_sod_version").data

// Get the content of the dataset x
a.root.x.data

// it is possible to open the dataset directly with its path
// Subgroups or datasets are separated with '/'
a("/x")

// Free the resources
h5close(a);

See also

History

VersionDescription
5.5.0 HDF5 module introduced.
Report an issue
<< H5 Objects HDF5 files h5read >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Feb 25 08:49:20 CET 2020