On 1/31/07, Luca Barbieri <[EMAIL PROTECTED]> wrote:
This patch allows to display simultaneously both the disk usage and
apparent size and also allows to display the "completeness" (or
"nonsparsity") of file, which is the ratio of the disk usage to the
apparent size.
For what it's worth, findutils-4.3 in CVS implements a similar feature:
static double
file_sparseness(const struct stat *p)
{
if (0 == p->st_size)
{
if (0 == p->st_blocks)
return 1.0;
else
return p->st_blocks < 0 ? -HUGE_VAL : HUGE_VAL;
}
else
{
double blklen = file_blocksize(p) * (double)p->st_blocks;
return blklen / p->st_size;
}
}
For instance, this is useful when dealing with software that download
files by creating sparse files and filling them: the "completeness" then
is approximately the progress of the download.
Personally, I don't like the name "completeness" very much; it
communicates nothing much to me.
James.
_______________________________________________
Bug-findutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-findutils