Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jan Moringen
asdf
Commits
51dd481a
Commit
51dd481a
authored
Nov 30, 2014
by
Robert P. Goldman
Browse files
Simplify PARSE-NATIVE-NAMESTRING
Remove early check for absolute pathname, deferring to ENSURE-PATHNAME.
parent
22cd9340
Changes
1
Hide whitespace changes
Inline
Side-by-side
uiop/filesystem.lisp
View file @
51dd481a
...
...
@@ -40,22 +40,18 @@
(
if
(
os-unix-p
)
(
unix-namestring
p
)
(
namestring
p
)))))
(
defun
parse-native-namestring
(
string
&rest
constraints
&key
want-absolute
ensure-directory
&allow-other-keys
)
(
defun
parse-native-namestring
(
string
&rest
constraints
&key
ensure-directory
&allow-other-keys
)
"From a native namestring suitable for use by the operating system, return
a CL pathname satisfying all the specified constraints as per ENSURE-PATHNAME"
(
check-type
string
(
or
string
null
))
(
let*
((
pathname
(
when
string
(
unless
(
or
(
not
want-absolute
)
(
absolute-pathname-p
string
))
(
error
"Invalid pathname ~S: Expected an absolute pathname."
string
))
(
with-pathname-defaults
()
#+
clozure
(
ccl:native-to-pathname
string
)
#+
sbcl
(
sb-ext:parse-native-namestring
string
)
#-
(
or
clozure
sbcl
)
(
if
(
os-unix-p
)
(
parse-unix-namestring
string
:ensure-directory
ensure-directory
)
(
parse-namestring
string
)))))
(
with-pathname-defaults
()
#+
clozure
(
ccl:native-to-pathname
string
)
#+
sbcl
(
sb-ext:parse-native-namestring
string
)
#-
(
or
clozure
sbcl
)
(
if
(
os-unix-p
)
(
parse-unix-namestring
string
:ensure-directory
ensure-directory
)
(
parse-namestring
string
))))
(
pathname
(
if
ensure-directory
(
and
pathname
(
ensure-directory-pathname
pathname
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment