Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asdf
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
15
Issues
15
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
asdf
asdf
Commits
6fd3151e
Commit
6fd3151e
authored
Feb 01, 2014
by
Francois-Rene Rideau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Workaround duplicate entries returned by clisp for (directory-files "~/")
parent
ffe14b71
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
16 deletions
+19
-16
uiop/filesystem.lisp
uiop/filesystem.lisp
+19
-16
No files found.
uiop/filesystem.lisp
View file @
6fd3151e
...
...
@@ -166,22 +166,25 @@ Try to override the defaults to not resolving symlinks, if implementation allows
"Given ENTRIES in a DIRECTORY, remove if the directory is logical
the entries which are physical yet when transformed by MERGER have a different TRUENAME.
This function is used as a helper to DIRECTORY-FILES to avoid invalid entries when using logical-pathnames."
(
if
(
logical-pathname-p
directory
)
;; Try hard to not resolve logical-pathname into physical pathnames;
;; otherwise logical-pathname users/lovers will be disappointed.
;; If directory* could use some implementation-dependent magic,
;; we will have logical pathnames already; otherwise,
;; we only keep pathnames for which specifying the name and
;; translating the LPN commute.
(
loop
:for
f
:in
entries
:for
p
=
(
or
(
and
(
logical-pathname-p
f
)
f
)
(
let*
((
u
(
ignore-errors
(
call-function
merger
f
))))
;; The first u avoids a cumbersome (truename u) error.
;; At this point f should already be a truename,
;; but isn't quite in CLISP, for it doesn't have :version :newest
(
and
u
(
equal
(
truename*
u
)
(
truename*
f
))
u
)))
:when
p
:collect
p
)
entries
))
(
remove-duplicates
;; on CLISP, querying ~/ will return duplicates
(
if
(
logical-pathname-p
directory
)
;; Try hard to not resolve logical-pathname into physical pathnames;
;; otherwise logical-pathname users/lovers will be disappointed.
;; If directory* could use some implementation-dependent magic,
;; we will have logical pathnames already; otherwise,
;; we only keep pathnames for which specifying the name and
;; translating the LPN commute.
(
loop
:for
f
:in
entries
:for
p
=
(
or
(
and
(
logical-pathname-p
f
)
f
)
(
let*
((
u
(
ignore-errors
(
call-function
merger
f
))))
;; The first u avoids a cumbersome (truename u) error.
;; At this point f should already be a truename,
;; but isn't quite in CLISP, for it doesn't have :version :newest
(
and
u
(
equal
(
truename*
u
)
(
truename*
f
))
u
)))
:when
p
:collect
p
)
entries
)
:test
'pathname-equal
))
(
defun
directory-files
(
directory
&optional
(
pattern
*wild-file*
))
"Return a list of the files in a directory according to the PATTERN,
...
...
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