Copies an HDF5 object within an HDF5 file or from one HDF5 file to another
h5copy [OPTIONS] [OBJECTS]
h5copy copies an HDF5 object (a dataset, named datatype, or group) from an input HDF5 file to an output HDF5 file.
If a group is specified as the input object, any objects in that group will be recursively copied.
The output file may or may not already exist.
h5copywill fail if the destination object name already exists.
Options and Parameters:
-h or --help
Print a usage message and exit.
-v or --verbose
Produce verbose output, printing information regarding the specified options and objects.
-V or --Version
Print version information.
-p or --parents
Create parent or intermediate groups as required. (There is no error if they already exist.)
-f flag_type or --flag=flag_type
Specify one or more of several copy options;flag_typemay be one of the following strings or a logical AND of two or more:
Copy only immediate members of a group. (Default:Recursively copy all objects below the group.)
Expand soft links to copy target objects. (Default:Keep soft links as they are.)
Expand external links to copy external objects. (Default:Keep external links as they are.)
Copy references and any referenced objects, i.e., objects that the references point to.
Referenced objects are copied in addition to the objects specified on the command line and reference datasets are populated with correct reference values. Copies of referenced datasets outside the copy range specified on the command line will normally have a different name from the original.
(Default:Without this option, reference value(s) in any reference datasets are set to NULL and referenced objects are not copied unless they are otherwise within the copy range specified on the command line.)
Copy objects without copying attributes. (Default:Copy objects and all attributes.)
Switch each setting above from the default to the setting described in this table. Equivalent to logical AND of all flags above.
Objects (all required):
-i input_file or --input=input_file
Input HDF5 file name
-o output_file or --output=output_file
Output HDF5 file name (existing or non-existing)
-s source_object or --source=source_object
Input HDF5 object name within the input file
-d destination_object or --destination=destination_object
Output HDF5 object name within the output file
An error occurred.
In verbose mode, create a new file,test1.out.h5, containing the objectarrayin the root group, copied from the existing filetest1.h5and objectarray.
In verbose mode and using the flagshallowto prevent recursion in the file hierarchy, create a new file,test1.out.h5, containing the objectarrayin the root group, copied from the existing filetest1.h5and objectarray.