Oihana PHP

getTotalDiskSpace.php

Table of Contents

Functions

getTotalDiskSpace()  : float
Returns the total size, in bytes, of the filesystem hosting a directory.

Functions

getTotalDiskSpace()

Returns the total size, in bytes, of the filesystem hosting a directory.

getTotalDiskSpace([string $directory = '.' ]) : float

Typed wrapper around disk_total_space(): an invalid path raises a FileException instead of returning false.

Parameters
$directory : string = '.'

A directory (or path) on the filesystem to inspect (default: '.').

Tags
throws
FileException

If the total space cannot be determined (e.g. invalid path).

author

Marc Alcaraz (ekameleon)

since
1.2.0
see
getFreeDiskSpace()
getDiskUsage()
example
use function oihana\files\getTotalDiskSpace;

$total = getTotalDiskSpace( '/' ) ;
Return values
float

The total number of bytes of the filesystem.

On this page

Search results