diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2008-08-25 15:57:14 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2008-08-25 15:57:14 (GMT) |
commit | 0c8cee593ff5907958fbe89de8a3bf6d1fe5b039 (patch) | |
tree | 32650b9979f7abf86b90215f3244ab74ed2df6e4 | |
parent | 769daf5479e7dc476611981317869ad27cb2c621 (diff) | |
download | hdf5-0c8cee593ff5907958fbe89de8a3bf6d1fe5b039.zip hdf5-0c8cee593ff5907958fbe89de8a3bf6d1fe5b039.tar.gz hdf5-0c8cee593ff5907958fbe89de8a3bf6d1fe5b039.tar.bz2 |
[svn-r15526] userblock options
only write the user block of a pre-existing file with user block in case there is no input user block file
tested: windows, linux
-rw-r--r-- | tools/h5repack/h5repack.c | 6 | ||||
-rw-r--r-- | tools/h5repack/h5repack_copy.c | 9 | ||||
-rw-r--r-- | tools/h5repack/h5repack_main.c | 2 |
3 files changed, 9 insertions, 8 deletions
diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c index 3809377..73f78f6 100644 --- a/tools/h5repack/h5repack.c +++ b/tools/h5repack/h5repack.c @@ -410,9 +410,9 @@ static int check_options(pack_opt_t *options) } - /*------------------------------------------------------------------------- - * verify new user userblock options - *------------------------------------------------------------------------- + /*-------------------------------------------------------------------------------- + * verify new user userblock options; both file name and block size must be present + *--------------------------------------------------------------------------------- */ if ( options->ublock_filename != NULL && options->ublock_size == 0 ) { diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index 3bff946..766da44 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -23,7 +23,7 @@ extern char *progname; -#if 0 +#if 1 #define H5REPACK_DEBUG #endif @@ -203,7 +203,7 @@ int copy_objects(const char* fnamein, *------------------------------------------------------------------------- */ - if ( options->ublock_size > 0 && options->ublock_filename != NULL ) + if ( options->ublock_size > 0 ) { /* either use the FCPL already created or create a new one */ if(fcpl != H5P_DEFAULT) @@ -261,7 +261,7 @@ int copy_objects(const char* fnamein, * write a new user block if requested *------------------------------------------------------------------------- */ - if ( options->ublock_size > 0 && options->ublock_filename != NULL ) + if ( options->ublock_size > 0 ) { copy_user_block( options->ublock_filename, fnameout, options->ublock_size); } @@ -312,7 +312,8 @@ int copy_objects(const char* fnamein, H5Fclose(fidin); H5Fclose(fidout); - if(ub_size > 0) + /* write only the input file user block if there is no user block file input */ + if(ub_size > 0 && options->ublock_size == 0) copy_user_block(fnamein, fnameout, ub_size); return 0; diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c index db0a87b..c949732 100644 --- a/tools/h5repack/h5repack_main.c +++ b/tools/h5repack/h5repack_main.c @@ -87,7 +87,7 @@ static struct long_options l_opts[] = { * PVN, May 16, 2008 * added backward compatibility for -i infile -o outfile * PVN, August 20, 2008 - * add a user block to file if requested (new switches -u -b) + * add a user block to repacked file (switches -u -b) *------------------------------------------------------------------------- */ int main(int argc, char **argv) |