/[cmucl]/src/code/filesys.lisp
ViewVC logotype

Diff of /src/code/filesys.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.43.2.4 by dtc, Wed Aug 23 15:53:13 2000 UTC revision 1.43.2.5 by dtc, Thu Aug 24 14:24:01 2000 UTC
# Line 869  Line 869 
869  ;;; DIRECTORY  --  public.  ;;; DIRECTORY  --  public.
870  ;;;  ;;;
871  (defun directory (pathname &key (all t) (check-for-subdirs t)  (defun directory (pathname &key (all t) (check-for-subdirs t)
872                             (follow-links t))                             (truenamep t) (follow-links t))
873    "Returns a list of pathnames, one for each file that matches the given    "Returns a list of pathnames, one for each file that matches the given
874     pathname.  Supplying :ALL as nil causes this to ignore Unix dot files.  This     pathname.  Supplying :ALL as nil causes this to ignore Unix dot files.  This
875     never includes Unix dot and dot-dot in the result.  If :FOLLOW-LINKS is NIL,     never includes Unix dot and dot-dot in the result.  If :TRUENAMEP is NIL,
876     then symblolic links in the result are not expanded.  This is not the     then symblolic links in the result are not expanded which is not the
877     default because TRUENAME does follow links, and the result pathnames are     default because TRUENAME does follow links, and the result pathnames are
878     defined to be the TRUENAME of the pathname (the truename of a link may well     defined to be the TRUENAME of the pathname (the truename of a link may well
879     be in another directory.)"     be in another directory.) If FOLLOW-LINKS is NIL then symbolic links are
880       not followed."
881    (let ((results nil))    (let ((results nil))
882      (enumerate-search-list      (enumerate-search-list
883          (pathname (merge-pathnames pathname          (pathname (merge-pathnames pathname
# Line 897  Line 898 
898                                             :directory))                                             :directory))
899                                    (concatenate 'string name "/")                                    (concatenate 'string name "/")
900                                    name)))                                    name)))
901                      (if follow-links (truename name) (pathname name))))                      (if truenamep (truename name) (pathname name))))
902                (sort (delete-duplicates results :test #'string=) #'string<)))))                (sort (delete-duplicates results :test #'string=) #'string<)))))
903    
904    
# Line 919  Line 920 
920    
921  (defun print-directory-verbose (pathname all return-list)  (defun print-directory-verbose (pathname all return-list)
922    (let ((contents (directory pathname :all all :check-for-subdirs nil    (let ((contents (directory pathname :all all :check-for-subdirs nil
923                               :follow-links nil))                               :truenamep nil))
924          (result nil))          (result nil))
925      (format t "Directory of ~A :~%" (namestring pathname))      (format t "Directory of ~A :~%" (namestring pathname))
926      (dolist (file contents)      (dolist (file contents)
# Line 994  Line 995 
995          (names ())          (names ())
996          (cnt 0)          (cnt 0)
997          (max-len 0)          (max-len 0)
998          (result (directory pathname :all all :follow-links nil)))          (result (directory pathname :all all :truenamep nil)))
999      (declare (list names) (fixnum max-len cnt))      (declare (list names) (fixnum max-len cnt))
1000      ;;      ;;
1001      ;; Get the data.      ;; Get the data.
# Line 1123  Line 1124 
1124                                 ignore-types)                                 ignore-types)
1125    (let ((files (directory (complete-file-directory-arg pathname defaults)    (let ((files (directory (complete-file-directory-arg pathname defaults)
1126                            :check-for-subdirs nil                            :check-for-subdirs nil
1127                            :follow-links nil)))                            :truenamep nil)))
1128      (cond ((null files)      (cond ((null files)
1129             (values nil nil))             (values nil nil))
1130            ((null (cdr files))            ((null (cdr files))
# Line 1191  Line 1192 
1192     We look in the directory specified by Defaults as well as looking down     We look in the directory specified by Defaults as well as looking down
1193     the search list."     the search list."
1194    (directory (complete-file-directory-arg pathname defaults)    (directory (complete-file-directory-arg pathname defaults)
1195               :follow-links nil               :truenamep nil
1196               :check-for-subdirs nil))               :check-for-subdirs nil))
1197    
1198    

Legend:
Removed from v.1.43.2.4  
changed lines
  Added in v.1.43.2.5

  ViewVC Help
Powered by ViewVC 1.1.5