mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-01-30 15:32:37 +08:00
[svn-r8739] Purpose: New feature and Bug fix
Description: 1. Added H5Fget_filesize and test(in file_handle.c) which returns the actual file size of an opened file. Also added to C++ API and test. 2. The error tests were messed up in test/Makefile.in. Solution: 1. Call H5FDget_eof to return file size. 2. Corrected. Platforms tested: h5committest Misc. update: RELEASE.txt
This commit is contained in:
parent
097510137d
commit
ac54089f54
@ -468,6 +468,7 @@ DataSpace H5File::getRegion(void *ref, H5R_type_t ref_type) const
|
||||
DataSpace dataspace(p_get_region(ref, ref_type));
|
||||
return(dataspace);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::getLocId
|
||||
// Purpose: Get the id of this file
|
||||
@ -481,6 +482,23 @@ hid_t H5File::getLocId() const
|
||||
return( getId() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::getFileSize
|
||||
///\brief Retrieves the file size of the HDF5 file. This function
|
||||
/// is called after an existing file is opened in order
|
||||
/// to learn the true size of the underlying file.
|
||||
///\exception H5::FileIException
|
||||
// Programmer Raymond Lu - June 24, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
haddr_t H5File::getFileSize(void) const
|
||||
{
|
||||
haddr_t ret_value = H5Fget_filesize(id);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw FileIException("H5File::getFileSize", "H5Fget_filesize failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::p_close (private)
|
||||
///\brief Closes this H5 file.
|
||||
|
@ -72,6 +72,9 @@ class H5_DLLCPP H5File : public IdComponent, public CommonFG {
|
||||
// Retrieves a dataspace with the region pointed to selected.
|
||||
DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const;
|
||||
|
||||
// Retrieves the file size of an opened file.
|
||||
haddr_t getFileSize() const;
|
||||
|
||||
// Reopens this file
|
||||
void reopen();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user