suve

awful: function: sysinfo-disk-used

Declaration

int :sysinfo-disk-used ( string $PATH )
int :sysinfo-disk-used

Summary

Returns the amount space used (in bytes) on 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.

Example

# sysinfo-disk-used example.
!fun :GiB $NUM
   :return :div (:mkfloat $NUM) :pow i2 i30
!nuf

:writeln s'Disk size: ' (:GiB :sysinfo-disk-total s'/') s'GiB'
:writeln s'Used: ' (:GiB :sysinfo-disk-used s'/') s'GiB'

wikistrona zmodyfikowana 2014/0601/2317