Skip to content

Commit

Permalink
Merge pull request #67 from cchampet/fix_ItemStatBlockSize
Browse files Browse the repository at this point in the history
ItemStat: fix sizeOnDisk on some file system
  • Loading branch information
cchampet authored Nov 24, 2016
2 parents 5652430 + 3b79af1 commit 48ef69d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/sequenceParser/ItemStat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ void ItemStat::statLink( const boost::filesystem::path& path )
minSize = size;
maxSize = size;
// size on hard-drive (takes hardlinks into account)
sizeOnDisk = (statInfos.st_blocks / nbHardLinks) * 512;
sizeOnDisk = (statInfos.st_blocks / nbHardLinks) * statInfos.st_blksize;
setPermissions(statInfos.st_mode);
#else
fullNbHardLinks = nbHardLinks = 1;
Expand Down Expand Up @@ -200,8 +200,7 @@ void ItemStat::statFolder( const boost::filesystem::path& path )
size = statInfos.st_size;
minSize = size;
maxSize = size;
// size on hard-drive (takes hardlinks into account)
sizeOnDisk = statInfos.st_blocks * 512;
sizeOnDisk = statInfos.st_blocks * statInfos.st_blksize;
setPermissions(statInfos.st_mode);
#else
deviceId = 0;
Expand Down Expand Up @@ -245,7 +244,7 @@ void ItemStat::statFile( const boost::filesystem::path& path )
accessTime = statInfos.st_atime;
lastChangeTime = statInfos.st_ctime;
// size on hard-drive (takes hardlinks into account)
sizeOnDisk = (statInfos.st_blocks / nbHardLinks) * 512;
sizeOnDisk = (statInfos.st_blocks / nbHardLinks) * statInfos.st_blksize;
setPermissions(statInfos.st_mode);
#else
deviceId = 0;
Expand Down

0 comments on commit 48ef69d

Please sign in to comment.