ambrevar/file: Return NIL for files that cannot be stat'ed.
For instance, Emacs unsaved buffer locks.master
parent
42335e2759
commit
31a4fffa30
|
@ -83,7 +83,9 @@ This returns the directory name for directories."
|
|||
(uiop:parse-native-namestring path)))))
|
||||
(assert (or (uiop:file-exists-p native-path)
|
||||
(uiop:directory-exists-p native-path)))
|
||||
(let ((stat (osicat-posix:stat native-path)))
|
||||
;; TODO: What do we do with non-existent files (e.g. unsaved emacs buffers)? Just return nil?
|
||||
(let ((stat (ignore-errors (osicat-posix:stat native-path))))
|
||||
(when stat
|
||||
;; From Osicat's `file-permissions':
|
||||
(flet ((stat-permissions (stat)
|
||||
(let ((mode (osicat-posix:stat-mode stat)))
|
||||
|
@ -101,7 +103,7 @@ This returns the directory name for directories."
|
|||
:creation-date (local-time:unix-to-timestamp (osicat-posix:stat-ctime stat))
|
||||
:modification-date (local-time:unix-to-timestamp (osicat-posix:stat-mtime stat))
|
||||
:access-date (local-time:unix-to-timestamp (osicat-posix:stat-atime stat))
|
||||
:permissions (stat-permissions stat))))))
|
||||
:permissions (stat-permissions stat)))))))
|
||||
|
||||
(export-always '*finder-include-directories*)
|
||||
(defvar *finder-include-directories* t
|
||||
|
|
Loading…
Reference in New Issue