Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
12
Task/Unix-ls/Common-Lisp/unix-ls.lisp
Normal file
12
Task/Unix-ls/Common-Lisp/unix-ls.lisp
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
(defun files-list (&optional (path "."))
|
||||
(let* ((dir (concatenate 'string path "/"))
|
||||
(abs-path (car (directory dir)))
|
||||
(file-pattern (concatenate 'string dir "*"))
|
||||
(subdir-pattern (concatenate 'string file-pattern "/")))
|
||||
(remove-duplicates
|
||||
(mapcar (lambda (p) (enough-namestring p abs-path))
|
||||
(mapcan #'directory (list file-pattern subdir-pattern)))
|
||||
:test #'string-equal)))
|
||||
|
||||
(defun ls (&optional (path "."))
|
||||
(format t "~{~a~%~}" (sort (files-list path) #'string-lessp)))
|
||||
Loading…
Add table
Add a link
Reference in a new issue