Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.1 - 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 Management > h5cp

h5cp

Copy an object

Syntax

h5cp(srcobj [, srcloc], destobj [, destloc])
h5cp(srcobj [, srcloc], destfile, destloc)
h5cp(srcfile, srcloc, destobj [, destloc])
h5cp(srcfile, srcloc, destfile, destloc)

Arguments

srcobj

a H5Object

destobj

a H5Object

srcloc

a string giving the source location

destloc

a string giving the destination location

srcfile

a string the source filename

destfile

a string giving the destination filename

Description

Copy an object to another place (same file or not).

Before copying a newly created object, the file must be flushed.

Examples

// We create a HDF5 file
a = h5open(TMPDIR + "/test.h5");
b = h5open(TMPDIR + "/test1.h5");

// We create a group and a dataset
h5group(a, "Grp_1");
h5write(a.root.Grp_1, "Dset_1", [1 2 ; 3 4]);

// We flush the file to be sure that the modifications
// will be taken into account when the copy will occur
h5flush(a);

// Create a group and a dataset in b
h5group(b, "BGrp");
h5write(b("/BGrp"), "BDset", 11:18);
h5close(b)

// Now we copy Dset_1 to Dset_2 located under root
h5cp(a.root.Grp_1, "Dset_1", a, "Dset_2")

// Copy BDset to a dataset under Grp_1
h5cp(TMPDIR  +"/test1.h5", "/BGrp/BDset", a.root.Grp_1)

// We can change the destination name
h5cp(TMPDIR  +"/test1.h5", "/BGrp/BDset", a.root.Grp_1, "The Foo Dataset")

// We have finished so we free all the resources
h5close(a);

See also

  • h5mv — Move an object
  • h5rm — Remove elements from an HDF5 file
  • h5flush — Flush all the buffers associated with a file

History

VersionDescription
5.5.0 HDF5 module introduced.
Report an issue
<< h5close HDF5 Management h5dataset >>

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:
Mon Feb 12 19:26:50 CET 2018