Re: Stat & Glob ?
- --- In firstname.lastname@example.org, Gordon Stewart <gordon52@s...>
> Hi there...
> Is there a way to combine stat & glob - or a 3rd function /
> Without globbing a directory, & finding a list of *.txt files.. &
> looping through the list, & doing a stat on each one ?the files
> or is that the only way ?
> IE - Ive got a directory, & wish to find out how much disk space
> are using, in total..I wrote a script to look at ALL files in a directory tree and add up
the sizes. I even got it to display 'human readable' sizes (like 'ls -
lh' or 'df -kh') with K, M and G (for KB, MB and GB of course).
It could be easily modified to permit specifying certain file types.
I used File::Find and the '-s' operator.
If you want the size of a directory tree on Unix you can use 'du'.