On 10/22/22 22:46, Bruce Gray wrote:


On Oct 22, 2022, at 11:30 PM, ToddAndMargo via perl6-users 
<perl6-users@perl.org> wrote:

Hi All,

Does Raku have a folder size command (including sub
folders)

or is that a system call?

There are system calls to get sizes of individual files (Raku IO objects 
provide the same function via the `.s()` method), but even in C language, you 
have to walk the directory tree and ask for the sizes of each file, then sum 
them yourself.

The File::Find module can handle the walking for you, allowing for this tight 
solution:

raku -e "use File::Find; say find(dir => <.>)ยป.s.sum;"



Thank you!

Reply via email to