ambrevar/file: Fix `file' on pathname.

master
Pierre Neidhardt 2021-01-15 12:45:18 +01:00
parent 81a54a0a7a
commit 65c7b851c4
1 changed files with 3 additions and 1 deletions

View File

@ -60,7 +60,9 @@ If none, return the empty string unlike `pathname-type'."
(export-always 'file)
(defun file (path)
(let ((native-path (uiop:truename* (uiop:parse-native-namestring path))))
(let ((native-path (uiop:truename* (if (pathnamep path)
path
(uiop:parse-native-namestring path)))))
(assert (uiop:file-exists-p native-path))
(let ((stat (osicat-posix:stat native-path)))
;; From Osicat's `file-permissions':