Handbook
Glossary
path>disk-usage ( path -- string )
Vocabulary
mason
.
disk
Inputs
path
an
object
Outputs
string
an
object
Definition
USING:
accessors
formatting
io.files.info
kernel
math
;
IN:
mason.disk
:
path>disk-usage
( path -- string )
find-mount-point
mount-point>>
file-system-info
[
used-space>>
]
[
available-space>>
]
[
total-space>>
]
tri
2dup
/f
100
*
[
[
Gi-str
]
tri@
]
dip
"%0.2fGi used, %0.2fGi avail, %0.2fGi total, %0.2f%% free"
sprintf
;