diff options
Diffstat (limited to 'tools/h5jam/h5unjam.c')
-rw-r--r-- | tools/h5jam/h5unjam.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/tools/h5jam/h5unjam.c b/tools/h5jam/h5unjam.c index 8e31ce1..fd79e1a 100644 --- a/tools/h5jam/h5unjam.c +++ b/tools/h5jam/h5unjam.c @@ -221,22 +221,20 @@ main(int argc, const char *argv[]) } - res = stat(input_file, &sbuf); + ifid = HDopen(input_file,O_RDONLY,0); + if(ifid < 0) { + error_msg("unable to open input HDF5 file \"%s\"\n", input_file); + exit(EXIT_FAILURE); + } - if (res < 0) { + res = HDfstat(ifid, &sbuf); + if(res < 0) { error_msg("Can't stat file \"%s\"\n", input_file); exit(EXIT_FAILURE); } fsize = sbuf.st_size; - ifid = HDopen(input_file,O_RDONLY,0); - - if (ifid < 0) { - error_msg("unable to open input HDF5 file \"%s\"\n", input_file); - exit(EXIT_FAILURE); - } - if (do_delete && (ub_file != NULL)) { error_msg("??\"%s\"\n", ub_file); exit(EXIT_FAILURE); |