From 8a1ba29743a5050b512c7aa26df84e0c3f5a9edc Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Tue, 9 Dec 2008 00:58:34 -0600 Subject: [PATCH] default values for file-systems slots --- basis/tools/files/files.factor | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/basis/tools/files/files.factor b/basis/tools/files/files.factor index db49dcbf61..a8ce9c9554 100755 --- a/basis/tools/files/files.factor +++ b/basis/tools/files/files.factor @@ -44,12 +44,13 @@ percent-used percent-free ; { device-name [ device-name>> ] } { mount-point [ mount-point>> ] } { type [ type>> ] } - { available-space [ available-space>> ] } - { free-space [ free-space>> ] } - { used-space [ used-space>> ] } - { total-space [ total-space>> ] } + { available-space [ available-space>> [ 0 ] unless* ] } + { free-space [ free-space>> [ 0 ] unless* ] } + { used-space [ used-space>> [ 0 ] unless* ] } + { total-space [ total-space>> [ 0 ] unless* ] } { percent-used [ - [ used-space>> ] [ total-space>> ] bi dup 0 = + [ used-space>> ] [ total-space>> ] bi + [ [ 0 ] unless* ] bi@ dup 0 = [ 2drop 0 ] [ / percent ] if ] } } case ;