Skip to main content

Module disk

Module disk 

Source
Expand description

How much room is left on the filesystem a path lives on.

Leviath asks this before letting an agent write, because the failure it guards against is not a bad write but a full disk: a run that filled C: took the machine down with it, and every other process on it (issue #252).

There is no free-space API in std, and this workspace forbids unsafe, so the syscall is delegated to fs4 - the same arrangement nix has here for process and permission calls.

Functionsยง

available_bytes
Bytes still writable on the filesystem containing path, or None when the question cannot be answered.
total_bytes
Total size of the filesystem containing path, or None when the question cannot be answered.