disk_total_space
(PHP 4 >= 4.1.0, PHP 5, PHP 7)
disk_total_space — ファイルシステムあるいはディスクパーティションの全体サイズを返す
説明
disk_total_space
( string $directory
) : float|false
ディレクトリを含む文字列を指定してください。この関数は、 ファイルシステムまたはディスクパーティションに対応する全体バイト数を返します。
パラメータ
directory
- ファイルシステムのディレクトリあるいはディスクパーティション。
返り値
総バイト数を float 型で返します。
失敗した場合に false
を返します。
例
例1 disk_total_space() の例
<?php// $ds は、「/」で利用可能な全体バイト数$ds = disk_total_space("/");// Windows の場合:$ds = disk_total_space("C:");$ds = disk_total_space("D:");?>
注意
注意:
この関数では、リモートファイル を 使用することはできません。これは、処理されるファイルがサーバーの ファイルシステムによりアクセスできる必要があるためです。