|
|

|
(PHP 3>= 3.0.7, PHP 4 >= 4.0.0) diskfreespace -- Returns available space in directory Descriptionfloat diskfreespace (string directory)
Given a string containing a directory, this function will return
the number of bytes available on the corresponding filesystem or
disk partition.
Örnek 1. diskfreespace() example
$df = diskfreespace("/"); // $df contains the number of bytes
// available on "/"
|
|
User Contributed Notes diskfreespace
|

|
per@pjd.nu
08-May-2001 12:02 |
|
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);
}
|
|
deepak_pradhan@yahoo.com
05-Sep-2001 01:11 |
|
This is Correct:
I need this because PHP installs the Apps.
// Free Space on H: drive
$df = (((diskfreespace("h:"))/1024)/1024)/1024;
echo "<hr>$df Gb<hr>";
// Free Space on C: drive
$df = (((diskfreespace("/"))/1024)/1024)/1024;
echo "<hr>$df Gb<hr>";
|
|

|
| |