Think about Loose Coupling | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hi borodache,
as a starting point, you might want to take a look at the following very basic subroutine which recursively traverses the subdirectory tree: Many things would need to be added: management of symbolic links in accordance with your needs, adding accumulators for cumulative size of directories, etc. Also note that I have used the -d, -f and -s file test operators for simplicity, but in a real program, I would probably use the stat (and possibly lstat) built-in function instead. Also, you might want to replace the glob function call by a opendir and readdir combination, together with appropriate calls to grep to get rid of entries such as . and .. (which are skipped by glob). Update: see To glob or not to glob for a discussion of glob and some of its advantages and disadvantages. In reply to Re: Get disk usage without modules
by Laurent_R
|
|