diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-02-13 22:42:43 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-02-13 22:42:43 (GMT) |
commit | d3c5ab50fc8fba8ff72417b125feaac8a3faed68 (patch) | |
tree | 541b46eca7b891581a3d29808806db8dfa73906c /tools/lib | |
parent | 1603adeaee43e22b61055633c1dc2250aaa3a922 (diff) | |
download | hdf5-d3c5ab50fc8fba8ff72417b125feaac8a3faed68.zip hdf5-d3c5ab50fc8fba8ff72417b125feaac8a3faed68.tar.gz hdf5-d3c5ab50fc8fba8ff72417b125feaac8a3faed68.tar.bz2 |
[svn-r13292] Description:
Add feature to h5copy to allow it to add an object to an existing file,
instead of blowing away existing file.
Modify h5tools_fopen() routine to take access flags, so it can be used
to open an existing file for writing.
Added check to h5copy test script that verifies it has produced a file
with the correct structure.
Tested on:
Linux/32 2.6 (chicago)
Linux/64 2.6 (chicago2)
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/h5tools.c | 8 | ||||
-rw-r--r-- | tools/lib/h5tools.h | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index c11718e..429898a 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -308,8 +308,8 @@ error: *------------------------------------------------------------------------- */ hid_t -h5tools_fopen(const char *fname, const char *driver, char *drivername, - size_t drivername_size) +h5tools_fopen(const char *fname, unsigned flags, const char *driver, + char *drivername, size_t drivername_size) { unsigned drivernum; hid_t fid = FAIL; @@ -321,7 +321,7 @@ h5tools_fopen(const char *fname, const char *driver, char *drivername, goto done; H5E_BEGIN_TRY { - fid = H5Fopen(fname, H5F_ACC_RDONLY, fapl); + fid = H5Fopen(fname, flags, fapl); } H5E_END_TRY; if (fid == FAIL) @@ -335,7 +335,7 @@ h5tools_fopen(const char *fname, const char *driver, char *drivername, goto done; H5E_BEGIN_TRY { - fid = H5Fopen(fname, H5F_ACC_RDONLY, fapl); + fid = H5Fopen(fname, flags, fapl); } H5E_END_TRY; if (fid != FAIL) diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index 49e7090..929cdd5 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -387,8 +387,8 @@ extern int bin_form; /* binary form */ /* Definitions of useful routines */ extern void h5tools_init(void); extern void h5tools_close(void); -extern hid_t h5tools_fopen(const char *fname, const char *driver, - char *drivername, size_t drivername_len); +extern hid_t h5tools_fopen(const char *fname, unsigned flags, + const char *driver, char *drivername, size_t drivername_len); extern int h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, hid_t dset, hid_t p_typ, struct subset_t *sset, int indentlevel); extern int h5tools_dump_mem(FILE *stream, const h5tool_format_t *info, hid_t obj_id, |