Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: du with backticks

by snoopy (Deacon)
on Mar 20, 2008 at 01:18 UTC ( #675139=note: print w/ replies, xml ) Need Help??


in reply to du with backticks

Maybe it's time consider refactoring this via CPAN modules? For comparison, the following achieves a similar result, using File::Find::Rule and Filesys::DiskUsage:

#/usr/bin/perl use warnings; use strict; use Filesys::DiskUsage qw/du/; use File::Find::Rule; use YAML; my $rule = File::Find::Rule->new; $rule->directory(); $rule->not($rule->new->name( qr/^.*Maildir.*(cur|new|courierimapkeywor +ds)$/)); my @dirs = $rule->in('.'); warn "dirs=@dirs"; my %sizes = du( { 'make-hash' => 1, 'human-readble' => 1, } , @dirs); print YAML::Dump(\%sizes);


Comment on Re: du with backticks
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://675139]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (10)
As of 2015-07-03 09:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (51 votes), past polls