suve

awful: function: sysinfo-swap-total

Declaration

int :sysinfo-swap-total

Summary

:!: Available only on Linux.

Returns the size of system's swap space, in bytes. Like other Linux-only sysinfo functions, the result is cached.

Example

# Sysinfo swap example.
!fun :GiB $NUM
  :return :div (:mkfloat $NUM) :pow i2 i30
!nuf

:writeln s'Swap space: ' (:GiB :sysinfo-swap-total) s'GiB'
:writeln s'Used: ' (:GiB :sysinfo-swap-used) s'GiB'
:writeln s'Free: ' (:GiB :sysinfo-swap-free) s'GiB'

wikipage modified on 2014/0601/2317