note 12805 deleted from function.diskfreespace by jimw
| From: | jimw@php.net | Date: | Wed, 02 Jan 2002 01:30:20 +0000 |
| Subject: | note 12805 deleted from function.diskfreespace by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-24098@lists.php.net to get a copy of this message | ||
If the configure script believes that neither statvfs nor statfs are available when building PHP,
this function always returns 0 on Unix systems (at least in 4.0.4pl1). We noticed this on a FreeBSD
system, and wrote a work-around function that uses df:
function i_diskFreeSpace($ls_directory)
{
exec("df -k ${ls_directory}", $la_rows, $li_code);
if($li_code == 0)
{
$la_cols = split(" +", $la_rows[1]);
return $la_cols[3] * 1024;
}
// Try if df fails
return diskfreespace($ls_directory);
}