disk_free_space
Description
The disk_free_space of Filesystem for PHP returns available space on filesystem or disk partition.
Syntax
disk_free_space(string $directory): float|false
Parameters
directory
A directory of the filesystem or disk partition.
Note: Given a file name instead of a directory, the behaviour of the function is unspecified and may differ between operating systems and PHP versions.
Return
Returns the number of available bytes as a float or false on failure.
Examples
1
<? $directory = "/"; $return = disk_free_space($directory); echo $return; ?>
156988612608
2 · windows
<? $directory = "C:"; $return = disk_free_space($directory); echo $return; ?>
156988628992
Links
Related
Filesystem
- basename
- chgrp
- chmod
- chown
- clearstatcache
- copy
- dirname
- disk_total_space
- diskfreespace
- fclose
- feof
- fflush
- fgetc
- fgetcsv
- fgets
- file
- file_exists
- file_get_contents
- file_put_contents
- fileatime
- filectime
- filegroup
- fileinode
- filemtime
- fileowner
- fileperms
- filesize
- filetype
- flock
- fnmatch
- fopen
- fpassthru
- fputcsv
- fputs
- fread
- fscanf
- fseek
- fstat
- ftell
- ftruncate
- fwrite
- glob
- is_dir
- is_executable
- is_file
- is_link
- is_readable
- is_uploaded_file
- is_writable
- is_writeable
- lchgrp
- lchown
- link
- linkinfo
- lstat
- mkdir
- move_uploaded_file
- pathinfo
- pclose
- popen
- readfile
- readlink
- realpath
- realpath_cache_get
- realpath_cache_size
- rename
- rewind
- rmdir
- set_file_buffer
- stat
- symlink
- tempnam
- tmpfile
- touch
- umask
- unlink