diff --git a/ls.scm b/ls.scm index ee78418..13646bc 100644 --- a/ls.scm +++ b/ls.scm @@ -55,8 +55,10 @@ (define (ls-path path all? recursive? long? directory? flag? columns? port) (cond - ((and (file-directory? path #f) - (not directory?)) + ((and (not directory?) + (or (and (file-name-directory? path) + (file-directory? path #t)) + (file-directory? path #f))) (ls-directory path all? recursive? long? directory? flag? columns? port)) (else (ls-file path long? flag? port)))) @@ -157,9 +159,25 @@ (display-permissions info port) (display-decimal-justified (file-info:nlinks info) 4 port) (write-char #\space port) - (let ((user-name (user-info:name (user-info (file-info:uid info))))) + (let* ((uid (file-info:uid info)) + (user-name + (call-with-current-continuation + (lambda (escape) + (with-handler + (lambda (condition more) + (escape (number->string uid))) + (lambda () + (user-info:name (user-info uid)))))))) (display-padded user-name 9 port)) - (let ((group-name (group-info:name (group-info (file-info:gid info))))) + (let* ((gid (file-info:gid info)) + (group-name + (call-with-current-continuation + (lambda (escape) + (with-handler + (lambda (condition more) + (escape (number->string gid))) + (lambda () + (group-info:name (group-info gid)))))))) (display-padded group-name 9 port)) (display-decimal-justified (file-info:size info) 7 port) (write-char #\space port) @@ -172,7 +190,6 @@ (display (read-symlink file-name) port))) (newline port))) - (define *year-seconds* (* 365 24 60 60)) (define (display-time the-time port) diff --git a/modules.scm b/modules.scm index 89a4f48..022be78 100644 --- a/modules.scm +++ b/modules.scm @@ -228,6 +228,7 @@ time->http-date-string begin-http-header + set-http-header-beginner! send-http-error-reply set-my-fqdn! @@ -411,7 +412,7 @@ (define-structure ls (export ls arguments->ls-flags) - (open scheme + (open scheme handle big-scheme bitwise scsh) (files ls))