How would I go about getting the size of a directory and all of its contents.. (it may have sub directories too)
I need a really fast way of doing it.
dont know if its the fastest but you could do something like
$blah = exec("du directory/");
then parse and add up all the lines it returns (it shouldnt be many).
This is for a *nix system.
Hope that Helps!
The thing is, the directories I need to get the size of are under the directory that Im running that script from..
and things like
$user = "testacc"; $blah = exec("du /home/$user"); echo $blah;
return nothing...
any ideas?
$blah = exec("du -h /home/directory | tail -n 1");
That had no output.... $blah = exec("du -h /home/testacc | tail -n 1"); echo $blah;
anybody else??!??!?!?!?? PLEASE!!!!!!!!!!!!!!!
and yes the directory /home/testacc exists with files in it 😉