Logo Search packages:      
Sourcecode: k4dirstat version File versions  Download package

KFileSize KFileInfo::allocatedSize (  ) const

The number of bytes actually allocated on the file system. Usually this will be more than byteSize() since the last few bytes of a file usually consume an additional cluster on the file system.

In the case of sparse files, however, this might as well be considerably less than byteSize() - this means that this file has "holes", i.e. large portions filled with zeros. This is typical for large core dumps for example. The only way to create such a file is to lseek() far ahead of the previous file size and then writing data. Most file system utilities will however disregard the fact that files are sparse files and simply allocate the holes as well, thus greatly increasing the disk space consumption of such a file. Only some few file system utilities like "cp", "rsync", "tar" have options to handle this more graciously - but usually only when specifically requested. See the respective man pages.

Definition at line 211 of file kfileinfo.cpp.

References blocks(), and blockSize().

Referenced by KDirStat::KDirTreeViewItem::init(), KFileInfo(), KDirStat::KDirTreeView::popupContextMenu(), and size().

    return blocks() * blockSize();

Here is the call graph for this function:

Here is the caller graph for this function:

Generated by  Doxygen 1.6.0   Back to index