Z
Zebee Johnstone
As people recommended using stat, I've tried.
But I seem to get different results to du, and different
to what my CD burning prog says.
#!/usr/bin/perl -w
use strict;
use File::Find;
my $total;
my $dir = shift;
find(\&wanted, $dir);
print "total = $total \n";
sub wanted {
$total += -s $File::Find::name;
}
produces:
total = 695543582
Running du -sb on the directory given to that program gets me:
750284800
So what am I missing about -s? That's a huge discrepancy, so
there's something that's not being counted.
I am running it as root, so it's not a permissions problem.
am I overflowing some buffer somewhere?
Zebee
But I seem to get different results to du, and different
to what my CD burning prog says.
#!/usr/bin/perl -w
use strict;
use File::Find;
my $total;
my $dir = shift;
find(\&wanted, $dir);
print "total = $total \n";
sub wanted {
$total += -s $File::Find::name;
}
produces:
total = 695543582
Running du -sb on the directory given to that program gets me:
750284800
So what am I missing about -s? That's a huge discrepancy, so
there's something that's not being counted.
I am running it as root, so it's not a permissions problem.
am I overflowing some buffer somewhere?
Zebee