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

Example

>>> disk_usage("/")
Returns:

A named tuple representing the disk usage statistics for the given path.

Return type:

psutil.disk_usage