mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-28 20:38:52 -06:00
fix: a full drive is an event, not stderr text
This commit is contained in:
1 parent
0b0bf29089
commit
8fc294ef97
15 files changed
+457
-491
No files matched your search
@@ -26,3 +26,10 @@ def free_space(bios_path: Path) -> int | None:
|
||||
return shutil.disk_usage(_nearest_folder(bios_path)).free
|
||||
except OSError:
|
||||
return None
|
||||
|
||||
|
||||
def space_shortfall(bios_path: Path, needed: int) -> tuple[int, int] | None:
|
||||
"""Needed and free when the drive holding bios_path cannot hold needed
|
||||
bytes, else None, also when its free space cannot be told."""
|
||||
free = free_space(bios_path)
|
||||
return None if free is None or free >= needed else (needed, free)
|
||||
Reference in new issue
Block a user