Skip to main content

Module df

Module df 

Source

Structs§

DfConfig
Configuration for the df command.
FsInfo
Filesystem information after calling statvfs.
MountEntry
A parsed mount entry from /proc/mounts.

Constants§

VALID_OUTPUT_FIELDS
Valid field names for –output.

Functions§

format_size
Format a size value according to the config.
get_filesystems
Get filesystem info for all relevant mount points. Returns (filesystems, had_error) where had_error is true if any file was not found.
human_readable_1000
Format a byte count in human-readable form using powers of 1000. GNU df uses ceiling rounding for human-readable display.
human_readable_1024
Format a byte count in human-readable form using powers of 1024. GNU df uses ceiling rounding for human-readable display.
parse_block_size
Parse a block size string like “1K”, “1M”, “1G”, etc.
parse_output_fields
Parse the –output field list.
read_mounts
Read mount entries from /proc/mounts (falls back to /etc/mtab).
run_df
Run the df command and write output.