Spaces:
Sleeping
Sleeping
Download File_Handling/check_disk_usage.py from AdityaSreevatsaK/Utility-Shelf: direct link, hf CLI and curl.
- Browser
- Download file 408 Bytes
-
https://huggingface.co/spaces/AdityaSreevatsaK/Utility-Shelf/resolve/main/File_Handling/check_disk_usage.py
- Command line
-
hf download hf://spaces/AdityaSreevatsaK/Utility-Shelf/File_Handling/check_disk_usage.py
-
curl -L -o check_disk_usage.py https://huggingface.co/spaces/AdityaSreevatsaK/Utility-Shelf/resolve/main/File_Handling/check_disk_usage.py
408 Bytes
| import shutil | |
| def check_disk_usage(path="/"): | |
| """ | |
| Description: Check the disk usage of the specified path. | |
| Args: | |
| path (str, optional): The path to check the disk usage for. Defaults to "/". | |
| Returns: | |
| (total, used, free): A tuple containing the total, used, and free disk space in bytes. | |
| """ | |
| total, used, free = shutil.disk_usage(path) | |
| return total, used, free | |