45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
;; Misc utils
;;======================================================================
(define-inline (debug:print n . params)
(if (<= n *verbosity*)
(apply print params)))
(define (get-df path)
(let* ((df-results (cmd-run->list (conc "df " path)))
(space-rx (regexp "([0-9]+)\\s+([0-9]+)%"))
(freespc #f))
;; (write df-results)
(for-each (lambda (l)
(let ((match (string-search space-rx l)))
|
>
>
>
>
>
>
>
>
>
|
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
;; Misc utils
;;======================================================================
(define-inline (debug:print n . params)
(if (<= n *verbosity*)
(apply print params)))
;; if a value is printable (i.e. string or number) return the value
;; else return an empty string
(define-inline (printable val)
(if (or (number? val)(string? val)) val ""))
;;======================================================================
;; System stuff
;;======================================================================
(define (get-df path)
(let* ((df-results (cmd-run->list (conc "df " path)))
(space-rx (regexp "([0-9]+)\\s+([0-9]+)%"))
(freespc #f))
;; (write df-results)
(for-each (lambda (l)
(let ((match (string-search space-rx l)))
|