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
13G /opt/zimbra/data/ldap/mdb/db/data.mdb
13G total
I'd like to be able to obtain the usage size via perl. Thanks!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Usage of a sparse file
by davido (Cardinal) on Mar 11, 2013 at 06:22 UTC | |
by mishikal (Novice) on Mar 11, 2013 at 08:01 UTC | |
Re: Usage of a sparse file
by mishikal (Novice) on Mar 11, 2013 at 08:16 UTC | |
by AnomalousMonk (Archbishop) on Mar 11, 2013 at 17:10 UTC | |
Re: Usage of a sparse file
by Anonymous Monk on Mar 11, 2013 at 12:54 UTC | |
by aitap (Curate) on Mar 11, 2013 at 16:02 UTC | |
by mishikal (Novice) on Mar 11, 2013 at 16:17 UTC | |
by aitap (Curate) on Mar 11, 2013 at 16:37 UTC | |
by mishikal (Novice) on Mar 20, 2013 at 01:28 UTC |
Back to
Seekers of Perl Wisdom