Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Fastest way to calculate directory size in linux

by DrHyde (Prior)
on Feb 02, 2012 at 10:57 UTC ( #951409=note: print w/ replies, xml ) Need Help??


in reply to Fastest way to calculate directory size in linux

If all you care about is the size of the directory, just use stat:

$ perl -e 'print +(stat("/tmp"))[7]' 49152

I have no idea whether stat() works on Windows or not, but it's not mentioned in perlport.


Comment on Re: Fastest way to calculate directory size in linux
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (12)
As of 2015-07-31 16:13 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 (279 votes), past polls