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

Re: looking for simple solution

by plaid (Chaplain)
on Jun 15, 2000 at 20:58 UTC ( #18321=note: print w/replies, xml ) Need Help??

in reply to looking for simple solution

I'm not quite sure what you mean by the size of a directory. If what you want is the actual byte size of the directory itself, you can just do
$size = (-s $directory);
If what you mean by size is the size of everything within it, you'll probably have to code something up by hand, preferably using File::Find to handle your recursion. I did a quick look on CPAN, but was unable to find any modules to handle disk usage.

If you do want the size of everything in the directory, and you're on unix, you can mess around with playing with the output of the system command 'du', but I don't recommend this for any script that will have a long life.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2022-01-19 04:58 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (55 votes). Check out past polls.