diff --git a/scheme/browse-directory-list.scm b/scheme/browse-directory-list.scm index c116b55..d8067b1 100644 --- a/scheme/browse-directory-list.scm +++ b/scheme/browse-directory-list.scm @@ -65,13 +65,28 @@ (else (number->string bytes))))) +(define (->username/save uid/name) + (with-fatal-error-handler + (lambda (condition more) + (if (number? uid/name) + (number->string uid/name) + uid/name)) + (->username uid/name))) + +(define (->groupname/save gid/name) + (with-fatal-error-handler + (lambda (condition more) + (if (number? gid/name) + (number->string gid/name) + gid/name)) + (->groupname gid/name))) + (define (format-user/group fi) (fill-up-string 17 (string-append - (cut-to-size 8 (->username (file-info:uid fi))) + (cut-to-size 8 (->username/save (file-info:uid fi))) ":" - (cut-to-size 8 (group-info:name - (group-info (file-info:gid fi))))))) + (cut-to-size 8 (->groupname/save (file-info:gid fi)))))) ;; leave one line for the heading (define (calculate-number-of-lines result-buffer)