pyufunc.disk_usage#
- pyufunc.disk_usage(path='/', *, unit='bytes')#
Return disk usage statistics about the given path as a named tuple including total, used and free space.
- Parameters:
path (str) – The path to check the disk usage for. Defaults to “/”.
unit (str) – The unit of the returned values. Defaults to “bytes”. - “bytes”: Return values in bytes. - “KB”: Return values in kilobytes. - “MB”: Return values in megabytes. - “GB”: Return values in gigabytes. If the unit is not recognized, it will default to “bytes”.
Note
Source package:
psutil.Source repository: giampaolo/psutil
Source document: https://psutil.readthedocs.io/en/latest/
Source license: BSD 3-Clause License.
Example
>>> disk_usage("/")
- Returns:
A named tuple representing the disk usage statistics for the given path.
- Return type:
psutil.disk_usage