mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-03-19 16:50:46 +08:00
[svn-r8820] Purpose: Bug fix
Description: After changing H5Fget_filesize, forgot to update C++. Platforms tested: Tested for 1.6
This commit is contained in:
parent
c949e7c391
commit
fde087cf57
@ -492,12 +492,14 @@ hid_t H5File::getLocId() const
|
||||
//--------------------------------------------------------------------------
|
||||
haddr_t H5File::getFileSize(void) const
|
||||
{
|
||||
haddr_t file_size = H5Fget_filesize(id);
|
||||
if( file_size < 0 )
|
||||
herr_t ret;
|
||||
|
||||
ret = H5Fget_filesize(id, size);
|
||||
if( ret < 0 )
|
||||
{
|
||||
throw FileIException("H5File::getFileSize", "H5Fget_filesize failed");
|
||||
}
|
||||
return(file_size);
|
||||
return ret;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
@ -73,7 +73,7 @@ class H5_DLLCPP H5File : public IdComponent, public CommonFG {
|
||||
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;
|
||||
herr_t getFileSize(hsize_t *size) const;
|
||||
|
||||
// Reopens this file
|
||||
void reopen();
|
||||
|
@ -337,8 +337,9 @@ test_file_size(void)
|
||||
H5File fid( FILE4, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl);
|
||||
|
||||
// Get file size
|
||||
haddr_t file_size = fid.getFileSize();
|
||||
CHECK(file_size, FAIL, "H5File::getFileSize");
|
||||
hsize_t file_size;
|
||||
herr_t ret = fid.getFileSize(&file_size);
|
||||
CHECK(ret, FAIL, "H5File::getFileSize");
|
||||
|
||||
// Check if file size is reasonable. It's supposed to be 2KB now.
|
||||
if(file_size<1*KB || file_size>4*KB)
|
||||
|
Loading…
x
Reference in New Issue
Block a user