|The stupid question is the question not asked|
Usage of a sparse fileby mishikal (Novice)
|on Mar 11, 2013 at 01:22 UTC||Need Help??|
mishikal has asked for the
wisdom of the Perl Monks concerning the following question:
Does anyone know how I can obtain actual usage size of a sparse file?
File::DiskUsage gives me the size of the sparse file. So does -s $file. stat gives me the total block size and blocks used, which isn't what I want either.
In my case, I have an 80GB sparse file with 13GB of actual data used:
zimbra@zre-ldap001:/tmp$ ls -l /opt/zimbra/data/ldap/mdb/db/data.mdb
-rw------- 1 zimbra zimbra 85899345920 Mar 8 19:11 /opt/zimbra/data/ldap/mdb/db/data.mdb
zimbra@zre-ldap001:/tmp$ du -c -h /opt/zimbra/data/ldap/mdb/db/data.mdb
I'd like to be able to obtain the usage size via perl. Thanks!