summaryrefslogtreecommitdiffstats
path: root/src/H5Fint.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2014-07-29 18:46:19 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2014-07-29 18:46:19 (GMT)
commit4094dc843f1d42c71f4239e084e640454430ce3a (patch)
tree36b88358507430f973675defbeb2cf12e2a1a227 /src/H5Fint.c
parent871d377e65de92637507295a05f67d52167e2af8 (diff)
downloadhdf5-4094dc843f1d42c71f4239e084e640454430ce3a.zip
hdf5-4094dc843f1d42c71f4239e084e640454430ce3a.tar.gz
hdf5-4094dc843f1d42c71f4239e084e640454430ce3a.tar.bz2
[svn-r25488] - fix bug with H5Fget_access_plist. need to set VOL and VOL info in property
- add tests for H5Fis_accessible in vfd tests to make sure it works with different fapls. - fix bug in Log VFD driver.
Diffstat (limited to 'src/H5Fint.c')
-rw-r--r--src/H5Fint.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/H5Fint.c b/src/H5Fint.c
index 6fe465a..1fe046f 100644
--- a/src/H5Fint.c
+++ b/src/H5Fint.c
@@ -634,26 +634,32 @@ done:
htri_t
H5F_is_hdf5(const char *name, hid_t fapl_id)
{
- H5FD_t *file = NULL; /* Low-level file struct */
+ H5F_t *file = NULL; /* Low-level file struct */
haddr_t sig_addr; /* Addess of hdf5 file signature */
htri_t ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
/* Open the file at the virtual file layer */
- if(NULL == (file = H5FD_open(name, H5F_ACC_RDONLY, fapl_id, HADDR_UNDEF)))
- HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to open file")
+ //if(NULL == (file = H5FD_open(name, H5F_ACC_RDONLY, fapl_id, HADDR_UNDEF)))
+ //HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to open file")
+
+ /* Open the file */
+ if(NULL == (file = H5F_open(name, H5F_ACC_RDONLY, H5P_FILE_CREATE_DEFAULT,
+ fapl_id, H5AC_ind_dxpl_id)))
+ HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FALSE, "unable to open file")
/* The file is an hdf5 file if the hdf5 file signature can be found */
- if(H5FD_locate_signature(file, H5AC_ind_dxpl_g, &sig_addr) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable to locate file signature")
+ if(H5FD_locate_signature(file->shared->lf, H5AC_ind_dxpl_g, &sig_addr) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FALSE, "unable to locate file signature")
ret_value = (HADDR_UNDEF != sig_addr);
done:
/* Close the file */
if(file)
- if(H5FD_close(file) < 0 && ret_value >= 0)
- HDONE_ERROR(H5E_IO, H5E_CANTCLOSEFILE, FAIL, "unable to close file")
+ //if(H5FD_close(file) < 0 && ret_value >= 0)
+ if(H5F_close(file) < 0 && ret_value >= 0)
+ HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "unable to close file")
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F_is_hdf5() */
@@ -1338,7 +1344,6 @@ H5F_close(H5F_t *f)
/* Sanity check */
HDassert(f);
- HDassert(f->id_exists); /* This routine should only be called when a file ID's ref count drops to zero */
/* Perform checks for "semi" file close degree here, since closing the
* file is not allowed if there are objects still open */