macos disk info

pull/210/head
cppla 2022-11-03 16:38:22 +08:00
parent a695ef8b3a
commit d602791b11
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ def get_swap():
def get_hdd():
# todo, 兼容macos ,beta
if "darwin" in sys.platform:
return int(psutil.disk_usage("/").total/1024.0/1024.0), int(psutil.disk_usage("/").used/1024.0/1024.0)
return int(psutil.disk_usage("/").total/1024.0/1024.0), int((psutil.disk_usage("/").total-psutil.disk_usage("/").free)/1024.0/1024.0)
else:
valid_fs = ["ext4", "ext3", "ext2", "reiserfs", "jfs", "btrfs", "fuseblk", "zfs", "simfs", "ntfs", "fat32",
"exfat", "xfs"]