summaryrefslogtreecommitdiffstats
path: root/tools/h5ls/h5ls.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2009-01-13 15:37:37 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2009-01-13 15:37:37 (GMT)
commit050ded21d307de35b0394614aa0962e8bca2f850 (patch)
treeb7c2cf2285664f0bd398fce943efc256d83b728e /tools/h5ls/h5ls.c
parente5630f3351dd32cac2da76985d69c13658152a98 (diff)
downloadhdf5-050ded21d307de35b0394614aa0962e8bca2f850.zip
hdf5-050ded21d307de35b0394614aa0962e8bca2f850.tar.gz
hdf5-050ded21d307de35b0394614aa0962e8bca2f850.tar.bz2
[svn-r16299] Print a message of
Storage: information not available When displaying storage information for VL and dataset region types Added 2 shell runs that display this information #818 Tested: windows, linux
Diffstat (limited to 'tools/h5ls/h5ls.c')
-rw-r--r--tools/h5ls/h5ls.c36
1 files changed, 29 insertions, 7 deletions
diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c
index eec1fcd..d0af4bb 100644
--- a/tools/h5ls/h5ls.c
+++ b/tools/h5ls/h5ls.c
@@ -1515,7 +1515,8 @@ dataset_list2(hid_t dset, const char UNUSED *name)
int ndims; /* dimensionality */
int n, max_len; /* max extern file name length */
double utilization; /* percent utilization of storage */
- int i;
+ H5T_class_t tclass; /* datatype class identifier */
+ int i;
if(verbose_g > 0) {
dcpl = H5Dget_create_plist(dset);
@@ -1539,14 +1540,35 @@ dataset_list2(hid_t dset, const char UNUSED *name)
/* Print total raw storage size */
total = H5Sget_simple_extent_npoints(space) * H5Tget_size(type);
used = H5Dget_storage_size(dset);
+ tclass = H5Tget_class(type);
printf(" %-10s ", "Storage:");
- printf("%lu logical byte%s, %lu allocated byte%s",
- (unsigned long)total, 1==total?"":"s",
- (unsigned long)used, 1==used?"":"s");
- if (used>0) {
- utilization = (total*100.0)/used;
- printf(", %1.2f%% utilization", utilization);
+ switch (tclass)
+ {
+
+ case H5T_VLEN:
+ printf("information not available");
+ break;
+
+ case H5T_REFERENCE:
+ if ( H5Tequal(type, H5T_STD_REF_DSETREG))
+ {
+ printf("information not available");
+ }
+ break;
+
+ default:
+ printf("%lu logical byte%s, %lu allocated byte%s",
+ (unsigned long)total, 1==total?"":"s",
+ (unsigned long)used, 1==used?"":"s");
+ if (used>0)
+ {
+ utilization = (total*100.0)/used;
+ printf(", %1.2f%% utilization", utilization);
+ }
+
}
+
+
putchar('\n');
/* Print information about external strorage */