★ wanayoo — archive 1999 http://www.php.net/manual/tr/function.diskfreespace.phpNouvelle recherche | Portail wanayoo
PHP
Wednesday, October 31, 2001  
downloads | documentation | faq | support | reporting bugs | links 

search for in the  


previousdirname
disk_total_spacenext

Last updated: Mon, 29 Oct 2001
view this page in English | Brazilian Portuguese | Czech | Dutch | French | German | Hungarian | Italian | Japanese | Korean | Polish | Spanish | Turkish | Plain HTML

diskfreespace

(PHP 3>= 3.0.7, PHP 4 >= 4.0.0)

diskfreespace -- Returns available space in directory

Description

float 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
add a note about notes
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>";

add a note about notes


previousdirname
disk_total_spacenext

Last updated: Mon, 29 Oct 2001

show source | credits | stats | mirror sites:  

Copyright © 2001 The PHP Group
All rights reserved.
This mirror generously provided by: Synacor
Last updated: Wed Oct 31 12:40:50 2001 EST