int :sysinfo-disk-free ( string $PATH )
int :sysinfo-disk-free
Returns the amount of free space (in bytes) of given disk. The parameter string is expected to contain a directory path - either relative or absolute. Under Windows, the function will refer to the appropriate disk - C:
, D:
, et cetera. Under Linux, the function will refer to the disk the directory resides on. When called with no parameter, refers to the current directory.
# sysinfo-disk-free example. !fun :GiB $UM :return :div (:mkfloat $NUM) :pow i2 i30 !nuf :writeln s'Disk size: ' (:GiB :sysinfo-disk-total s'/') s'GiB' :writeln s'Free space: ' (:GiB :sysinfo-disk-free s'/') s'GiB'
wikipage modified on 2014/0601/2317