Hello,
I written a simple php script to calcolate disk usage
on a directory ($name) using the linux command du ,
<?
ob_start();
passthru("/usr/bin/du -sk /home/$user/$name");
$spacea = ob_get_contents();
ob_end_clean();
$spaceb = ereg_replace ("/home/$user", "", $spacea);
$spaceb = str_replace(' ','',$spaceb);
$spacec = $spaceb/1024;
$spaced = number_format($spacec, 3, ',', ' ');
?>
Unluckly sometime if some directory contains "restrictive" permission or chOwn it could returns some error lines like these
/usr/bin/du: cannot change to directory /home/test/catalogs/test/session/Z': Permission denied
Is there any way to delete this error output ?
Thanks