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

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

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

Scilab Help >> HDF5 Management > h5open


Open an HDF5 file

Calling Sequence

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



a string giving the filename


A string giving the access mode to use


A string giving the driver name


A boolean or a double depending of the driver value


A H5Object corresponding to the open file


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.


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

// list the contents of the root element.

// Get the SOD version

// or if the name contains 'invalid' chars

// Get the content of the dataset x

// it is possible to open the dataset directly with its path
// Subgroups or datasets are separated with '/'

// Free the resources

See Also


5.5.0 HDF5 module introduced.
Report an issue
<< H5 Objects HDF5 Management 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:
Wed Apr 01 10:13:56 CEST 2015