disk_info: implement %avail

This commit is contained in:
Mirko Augsburger 2010-06-25 01:19:09 +02:00 committed by Michael Stapelberg
parent 71f7166032
commit 28ba2ae892
2 changed files with 7 additions and 2 deletions

View File

@ -125,11 +125,11 @@ best available public IPv6 address on your computer).
=== Disk
Gets used, free and total amount of bytes on the given mounted filesystem.
Gets used, free, available and total amount of bytes on the given mounted filesystem.
*Example order*: +disk /mnt/usbstick+
*Example format*: +%free / %total+
*Example format*: +%free (%avail)/ %total+
=== Run-watch

View File

@ -64,5 +64,10 @@ void print_disk_info(const char *path, const char *format) {
print_bytes_human((uint64_t)buf.f_bsize * (uint64_t)buf.f_blocks);
walk += strlen("total");
}
if (BEGINS_WITH(walk+1, "avail")) {
print_bytes_human((uint64_t)buf.f_bsize * (uint64_t)buf.f_bavail);
walk += strlen("avail");
}
}
}