From 764a09dddf1f7748f1c6ce43716acd809133e358 Mon Sep 17 00:00:00 2001 From: MuQun Yang Date: Fri, 13 Dec 2002 11:29:01 -0500 Subject: [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. --- test/dsets.c | 11 ++++++----- 1 file 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); -- cgit v0.12