Re: Size of dir (with recursion)

2003-12-29 Thread Shawn
While you're at it, write a parallel version of du.pl... Modern hard drives do scatter gather, and reading lots (say 10 or so) of dirs' contents' block sizes at a time would be interesting... It would be cool if a parent kept 20 children pre-forked, and only told 10 children at a time to do their

Re: Size of dir (with recursion)

2003-12-29 Thread John W. Krahn
Jesper Noehr wrote: > > On Mon, 29 Dec 2003 13:19:29 -0800, John W. Krahn <[EMAIL PROTECTED]> wrote: > > > > $ ls -l test.txt > > -rw-r--r--1 john users 187 Jul 9 11:54 test.txt > > $ perl -le'print +(lstat shift)[11]' test.txt > > 4096 > > $ du -b test.txt > > 4096test.txt >

Re: Size of dir (with recursion)

2003-12-29 Thread Jesper Noehr
On Mon, 29 Dec 2003 13:19:29 -0800, John W. Krahn <[EMAIL PROTECTED]> wrote: Jesper Noehr wrote: Hey list. Hello, I'm having a problem reading the size of a directory with recursive directories. The problem is that du -s shows a different bytecount than my program does. $ man du NAME du

Re: Size of dir (with recursion)

2003-12-29 Thread John W. Krahn
Jesper Noehr wrote: > > Hey list. Hello, > I'm having a problem reading the size of a directory with recursive > directories. > The problem is that du -s shows a different bytecount than my program does. $ man du NAME du - estimate file space usage SYNOPSIS du [OPTION]... [FILE]

Size of dir (with recursion)

2003-12-29 Thread Jesper Noehr
Hey list. I'm having a problem reading the size of a directory with recursive directories. The problem is that du -s shows a different bytecount than my program does. Here's my code: #!/usr/gnu/bin/perl -w use File::Find; @ARGV = ('.') unless @ARGV; my $sum = 0; find sub { $sum += -s }, @ARGV;