Php/docs/function.disk-total-space

提供:Dev Guides
< Php
移動先:案内検索

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:");?>

注意

注意:

この関数では、

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

参考

  • disk_free_space() - ファイルシステムあるいはディスクパーティション上で利用可能な領域を返す