getDiskUsage.php
Table of Contents
Functions
- getDiskUsage() : float
- Returns the number of used bytes on the filesystem hosting a directory.
Functions
getDiskUsage()
Returns the number of used bytes on the filesystem hosting a directory.
getDiskUsage([string $directory = '.' ]) : float
Computed as getTotalDiskSpace() − getFreeDiskSpace(), so the result shares the same unit (bytes) as the two helpers it builds on. Pair it with formatFileSize() for a human-readable value, or divide by getTotalDiskSpace() for a usage ratio.
Parameters
- $directory : string = '.'
-
A directory (or path) on the filesystem to inspect (default:
'.').
Tags
Return values
float —The number of used bytes.