disk_total_space

ファイルシステムあるいはディスクパーティションの全体サイズを返す

説明

floatfalse disk_total_space(string $directory)

ディレクトリを含む文字列を指定してください。この関数は、 ファイルシステムまたはディスクパーティションに対応する全体バイト数を返します。

パラメータ

directory

ファイルシステムのディレクトリあるいはディスクパーティション。

戻り値

総バイト数を float 型で返します。 失敗した場合に false を返します。

例1 disk_total_space の例

<?php
// $ds は、「/」で利用可能な全体バイト数
$ds disk_total_space("/");

// Windows の場合:
$ds disk_total_space("C:");
$ds disk_total_space("D:");
?>

注意

注意: この関数では、 リモートファイル を 使用することはできません。これは、処理されるファイルがサーバーの ファイルシステムによりアクセスできる必要があるためです。

参考

  • disk_free_space