[svn-r22121] Purpose:
update for HDFFV-7523 JPSS: h5dump fails to open an attribute when using the -a option to specify an attribute with a slash in the name Description: Added capability for "-a" option to show attributes containing "/" by using an escape character. For example, for a dataset "/dset" containing attribute "speed(m/h)", use "h5dump -a "/dset/speed(\/h)" to show the content of the attribute. Merged from HDF5 trunk r22052, r22063, r22108 Tested: jam (linux32-LE), koala (linux64-LE), ostrich (linuxppc64-BE), tejeda (mac32-LE), Windows (32-LE cmake), Cmake (jam)
This commit is contained in:
@@ -243,6 +243,9 @@ usage(const char *prog)
|
||||
HDfprintf(rawoutstream, " -e, --escape Escape non printing characters\n");
|
||||
HDfprintf(rawoutstream, " -V, --version Print version number and exit\n");
|
||||
HDfprintf(rawoutstream, " -a P, --attribute=P Print the specified attribute\n");
|
||||
HDfprintf(rawoutstream, " If an attribute name contains a slash (/), escape the\n");
|
||||
HDfprintf(rawoutstream, " slash with a preceding backslash (\\).\n");
|
||||
HDfprintf(rawoutstream, " (See example section below.)\n");
|
||||
HDfprintf(rawoutstream, " -d P, --dataset=P Print the specified dataset\n");
|
||||
HDfprintf(rawoutstream, " -y, --noindex Do not print array indices with the data\n");
|
||||
HDfprintf(rawoutstream, " -p, --properties Print dataset filters, storage layout and fill value\n");
|
||||
@@ -316,6 +319,10 @@ usage(const char *prog)
|
||||
HDfprintf(rawoutstream, "\n");
|
||||
HDfprintf(rawoutstream, " h5dump -a /bar_none/foo quux.h5\n");
|
||||
HDfprintf(rawoutstream, "\n");
|
||||
HDfprintf(rawoutstream, " Attribute \"high/low\" of the group /bar_none in the file quux.h5\n");
|
||||
HDfprintf(rawoutstream, "\n");
|
||||
HDfprintf(rawoutstream, " h5dump -a \"/bar_none/high\\/low\" quux.h5\n");
|
||||
HDfprintf(rawoutstream, "\n");
|
||||
HDfprintf(rawoutstream, " 2) Selecting a subset from dataset /foo in file quux.h5\n");
|
||||
HDfprintf(rawoutstream, "\n");
|
||||
HDfprintf(rawoutstream, " h5dump -d /foo -s \"0,1\" -S \"1,1\" -c \"2,3\" -k \"2,2\" quux.h5\n");
|
||||
|
||||
@@ -417,7 +417,7 @@ gent_attribute(void)
|
||||
/* attribute 1 */
|
||||
dims[0] = 24;
|
||||
space = H5Screate_simple(1, dims, NULL);
|
||||
attr = H5Acreate2(root, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT);
|
||||
attr = H5Acreate2(root, "/attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT);
|
||||
sprintf(buf, "attribute of root group");
|
||||
H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
|
||||
H5Sclose(space);
|
||||
|
||||
@@ -10,6 +10,9 @@ usage: h5dump [OPTIONS] files
|
||||
-e, --escape Escape non printing characters
|
||||
-V, --version Print version number and exit
|
||||
-a P, --attribute=P Print the specified attribute
|
||||
If an attribute name contains a slash (/), escape the
|
||||
slash with a preceding backslash (\).
|
||||
(See example section below.)
|
||||
-d P, --dataset=P Print the specified dataset
|
||||
-y, --noindex Do not print array indices with the data
|
||||
-p, --properties Print dataset filters, storage layout and fill value
|
||||
@@ -81,6 +84,10 @@ usage: h5dump [OPTIONS] files
|
||||
|
||||
h5dump -a /bar_none/foo quux.h5
|
||||
|
||||
Attribute "high/low" of the group /bar_none in the file quux.h5
|
||||
|
||||
h5dump -a "/bar_none/high\/low" quux.h5
|
||||
|
||||
2) Selecting a subset from dataset /foo in file quux.h5
|
||||
|
||||
h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5
|
||||
|
||||
@@ -10,6 +10,9 @@ usage: h5dump [OPTIONS] files
|
||||
-e, --escape Escape non printing characters
|
||||
-V, --version Print version number and exit
|
||||
-a P, --attribute=P Print the specified attribute
|
||||
If an attribute name contains a slash (/), escape the
|
||||
slash with a preceding backslash (\).
|
||||
(See example section below.)
|
||||
-d P, --dataset=P Print the specified dataset
|
||||
-y, --noindex Do not print array indices with the data
|
||||
-p, --properties Print dataset filters, storage layout and fill value
|
||||
@@ -81,6 +84,10 @@ usage: h5dump [OPTIONS] files
|
||||
|
||||
h5dump -a /bar_none/foo quux.h5
|
||||
|
||||
Attribute "high/low" of the group /bar_none in the file quux.h5
|
||||
|
||||
h5dump -a "/bar_none/high\/low" quux.h5
|
||||
|
||||
2) Selecting a subset from dataset /foo in file quux.h5
|
||||
|
||||
h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5
|
||||
|
||||
@@ -10,6 +10,9 @@ usage: h5dump [OPTIONS] files
|
||||
-e, --escape Escape non printing characters
|
||||
-V, --version Print version number and exit
|
||||
-a P, --attribute=P Print the specified attribute
|
||||
If an attribute name contains a slash (/), escape the
|
||||
slash with a preceding backslash (\).
|
||||
(See example section below.)
|
||||
-d P, --dataset=P Print the specified dataset
|
||||
-y, --noindex Do not print array indices with the data
|
||||
-p, --properties Print dataset filters, storage layout and fill value
|
||||
@@ -81,6 +84,10 @@ usage: h5dump [OPTIONS] files
|
||||
|
||||
h5dump -a /bar_none/foo quux.h5
|
||||
|
||||
Attribute "high/low" of the group /bar_none in the file quux.h5
|
||||
|
||||
h5dump -a "/bar_none/high\/low" quux.h5
|
||||
|
||||
2) Selecting a subset from dataset /foo in file quux.h5
|
||||
|
||||
h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5
|
||||
|
||||
@@ -10,6 +10,9 @@ usage: h5dump [OPTIONS] files
|
||||
-e, --escape Escape non printing characters
|
||||
-V, --version Print version number and exit
|
||||
-a P, --attribute=P Print the specified attribute
|
||||
If an attribute name contains a slash (/), escape the
|
||||
slash with a preceding backslash (\).
|
||||
(See example section below.)
|
||||
-d P, --dataset=P Print the specified dataset
|
||||
-y, --noindex Do not print array indices with the data
|
||||
-p, --properties Print dataset filters, storage layout and fill value
|
||||
@@ -81,6 +84,10 @@ usage: h5dump [OPTIONS] files
|
||||
|
||||
h5dump -a /bar_none/foo quux.h5
|
||||
|
||||
Attribute "high/low" of the group /bar_none in the file quux.h5
|
||||
|
||||
h5dump -a "/bar_none/high\/low" quux.h5
|
||||
|
||||
2) Selecting a subset from dataset /foo in file quux.h5
|
||||
|
||||
h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5
|
||||
|
||||
@@ -10,6 +10,9 @@ usage: h5dump [OPTIONS] files
|
||||
-e, --escape Escape non printing characters
|
||||
-V, --version Print version number and exit
|
||||
-a P, --attribute=P Print the specified attribute
|
||||
If an attribute name contains a slash (/), escape the
|
||||
slash with a preceding backslash (\).
|
||||
(See example section below.)
|
||||
-d P, --dataset=P Print the specified dataset
|
||||
-y, --noindex Do not print array indices with the data
|
||||
-p, --properties Print dataset filters, storage layout and fill value
|
||||
@@ -81,6 +84,10 @@ usage: h5dump [OPTIONS] files
|
||||
|
||||
h5dump -a /bar_none/foo quux.h5
|
||||
|
||||
Attribute "high/low" of the group /bar_none in the file quux.h5
|
||||
|
||||
h5dump -a "/bar_none/high\/low" quux.h5
|
||||
|
||||
2) Selecting a subset from dataset /foo in file quux.h5
|
||||
|
||||
h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5
|
||||
|
||||
@@ -10,6 +10,9 @@ usage: h5dump [OPTIONS] files
|
||||
-e, --escape Escape non printing characters
|
||||
-V, --version Print version number and exit
|
||||
-a P, --attribute=P Print the specified attribute
|
||||
If an attribute name contains a slash (/), escape the
|
||||
slash with a preceding backslash (\).
|
||||
(See example section below.)
|
||||
-d P, --dataset=P Print the specified dataset
|
||||
-y, --noindex Do not print array indices with the data
|
||||
-p, --properties Print dataset filters, storage layout and fill value
|
||||
@@ -81,6 +84,10 @@ usage: h5dump [OPTIONS] files
|
||||
|
||||
h5dump -a /bar_none/foo quux.h5
|
||||
|
||||
Attribute "high/low" of the group /bar_none in the file quux.h5
|
||||
|
||||
h5dump -a "/bar_none/high\/low" quux.h5
|
||||
|
||||
2) Selecting a subset from dataset /foo in file quux.h5
|
||||
|
||||
h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5
|
||||
|
||||
@@ -10,6 +10,9 @@ usage: h5dump [OPTIONS] files
|
||||
-e, --escape Escape non printing characters
|
||||
-V, --version Print version number and exit
|
||||
-a P, --attribute=P Print the specified attribute
|
||||
If an attribute name contains a slash (/), escape the
|
||||
slash with a preceding backslash (\).
|
||||
(See example section below.)
|
||||
-d P, --dataset=P Print the specified dataset
|
||||
-y, --noindex Do not print array indices with the data
|
||||
-p, --properties Print dataset filters, storage layout and fill value
|
||||
@@ -81,6 +84,10 @@ usage: h5dump [OPTIONS] files
|
||||
|
||||
h5dump -a /bar_none/foo quux.h5
|
||||
|
||||
Attribute "high/low" of the group /bar_none in the file quux.h5
|
||||
|
||||
h5dump -a "/bar_none/high\/low" quux.h5
|
||||
|
||||
2) Selecting a subset from dataset /foo in file quux.h5
|
||||
|
||||
h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5
|
||||
|
||||
@@ -10,6 +10,9 @@ usage: h5dump [OPTIONS] files
|
||||
-e, --escape Escape non printing characters
|
||||
-V, --version Print version number and exit
|
||||
-a P, --attribute=P Print the specified attribute
|
||||
If an attribute name contains a slash (/), escape the
|
||||
slash with a preceding backslash (\).
|
||||
(See example section below.)
|
||||
-d P, --dataset=P Print the specified dataset
|
||||
-y, --noindex Do not print array indices with the data
|
||||
-p, --properties Print dataset filters, storage layout and fill value
|
||||
@@ -81,6 +84,10 @@ usage: h5dump [OPTIONS] files
|
||||
|
||||
h5dump -a /bar_none/foo quux.h5
|
||||
|
||||
Attribute "high/low" of the group /bar_none in the file quux.h5
|
||||
|
||||
h5dump -a "/bar_none/high\/low" quux.h5
|
||||
|
||||
2) Selecting a subset from dataset /foo in file quux.h5
|
||||
|
||||
h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5
|
||||
|
||||
Reference in New Issue
Block a user