diff options
author | MuQun Yang <ymuqun@hdfgroup.org> | 2002-12-13 16:29:01 (GMT) |
---|---|---|
committer | MuQun Yang <ymuqun@hdfgroup.org> | 2002-12-13 16:29:01 (GMT) |
commit | 764a09dddf1f7748f1c6ce43716acd809133e358 (patch) | |
tree | 6340236d1ecf1f0136e9599e2a473f1981f7e352 /test | |
parent | 1c0e435421c64f550040a2d34e63535e69dfcfb2 (diff) | |
download | hdf5-764a09dddf1f7748f1c6ce43716acd809133e358.zip hdf5-764a09dddf1f7748f1c6ce43716acd809133e358.tar.gz hdf5-764a09dddf1f7748f1c6ce43716acd809133e358.tar.bz2 |
[svn-r6203]
Purpose:
bug fixed for windows
Description:
windows fopen functions by default opens a text mode file. It will fail for HDF5 file.
So to use HDopen HDread HDclose for test.
Solution:
Change from fopen, fread, fclose to HDopen, HDread, HDclose.
Platforms tested:
linux2.2.18smp, windows 2000
Misc. update:
Update MANIFEST if you add or remove any file.
Update release_docs/RELEASE for bug fixes, new features, etc.
Update applicable document files too.
Diffstat (limited to 'test')
-rw-r--r-- | test/dsets.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/test/dsets.c b/test/dsets.c index 0402f46..3a7e561 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -329,7 +329,8 @@ test_userblock_offset(hid_t fapl) hid_t file, fcpl, dataset, space; int i, j, n; hsize_t dims[2]; - FILE *f; +/* FILE *f;*/ + int f; haddr_t offset; int rdata[100][200]; @@ -369,9 +370,9 @@ test_userblock_offset(hid_t fapl) * compare it with the data written in.*/ if((offset=H5Dget_offset(dataset))==HADDR_UNDEF) goto error; - f = fopen(filename, "r"); - fseek(f, (long int)offset, SEEK_SET); - fread(rdata, sizeof(int), 100*200, f); + f = HDopen(filename, O_RDONLY, 0); + HDlseek(f, (off_t)offset, SEEK_SET); + HDread(f, rdata, sizeof(int)*100*200); /* Check that the values read are the same as the values written */ for (i = 0; i < 100; i++) { @@ -385,7 +386,7 @@ test_userblock_offset(hid_t fapl) } } - fclose(f); + HDclose(f); H5Dclose(dataset); H5Fclose(file); |