function Filesystem::size
Returns size of a file or directory specified by path. If a directory is given, its size will be computed recursively.
Parameters
string $path Path to the file or directory:
Return value
int
Throws
\RuntimeException
File
-
vendor/
composer/ composer/ src/ Composer/ Util/ Filesystem.php, line 578
Class
- Filesystem
- @author Jordi Boggiano <j.boggiano@seld.be> @author Johannes M. Schmitt <schmittjoh@gmail.com>
Namespace
Composer\UtilCode
public function size(string $path) {
if (!file_exists($path)) {
throw new \RuntimeException("{$path} does not exist.");
}
if (is_dir($path)) {
return $this->directorySize($path);
}
return (int) filesize($path);
}