/[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.1 by pw, Tue Jun 23 11:21:54 1998 UTC revision 1.43.2.2 by dtc, Sun Jul 19 01:06:05 1998 UTC
# Line 664  Line 664 
664    An error of type file-error is signalled if no such file exists,    An error of type file-error is signalled if no such file exists,
665    or the pathname is wild."    or the pathname is wild."
666    (if (wild-pathname-p pathname)    (if (wild-pathname-p pathname)
667        (error 'file-error        (error 'simple-file-error
668               :format-control "Bad place for a wild pathname."               :format-control "Bad place for a wild pathname."
669               :pathname pathname)               :pathname pathname)
670        (let ((result (probe-file pathname)))        (let ((result (probe-file pathname)))
671          (unless result          (unless result
672            (error 'file-error            (error 'simple-file-error
673                   :pathname pathname                   :pathname pathname
674                   :format-control "The file ~S does not exist."                   :format-control "The file ~S does not exist."
675                   :format-arguments (list (namestring pathname))))                   :format-arguments (list (namestring pathname))))
# Line 683  Line 683 
683    "Return a pathname which is the truename of the file if it exists, NIL    "Return a pathname which is the truename of the file if it exists, NIL
684    otherwise. An error of type file-error is signaled if pathname is wild."    otherwise. An error of type file-error is signaled if pathname is wild."
685    (if (wild-pathname-p pathname)    (if (wild-pathname-p pathname)
686        (error 'file-error        (error 'simple-file-error
687               :pathname pathname               :pathname pathname
688               :format-control "Bad place for a wild pathname.")               :format-control "Bad place for a wild pathname.")
689        (let ((namestring (unix-namestring pathname t)))        (let ((namestring (unix-namestring pathname t)))
# Line 708  Line 708 
708           (new-name (merge-pathnames new-name original))           (new-name (merge-pathnames new-name original))
709           (new-namestring (unix-namestring new-name nil)))           (new-namestring (unix-namestring new-name nil)))
710      (unless new-namestring      (unless new-namestring
711        (error 'file-error        (error 'simple-file-error
712               :pathname new-name               :pathname new-name
713               :format-control "~S can't be created."               :format-control "~S can't be created."
714               :format-arguments (list new-name)))               :format-arguments (list new-name)))
# Line 716  Line 716 
716                           (unix:unix-rename original-namestring                           (unix:unix-rename original-namestring
717                                             new-namestring)                                             new-namestring)
718        (unless res        (unless res
719          (error 'file-error          (error 'simple-file-error
720                 :pathname new-name                 :pathname new-name
721                 :format-control "Failed to rename ~A to ~A: ~A"                 :format-control "Failed to rename ~A to ~A: ~A"
722                 :format-arguments (list original new-name                 :format-arguments (list original new-name
# Line 735  Line 735 
735      (when (streamp file)      (when (streamp file)
736        (close file :abort t))        (close file :abort t))
737      (unless namestring      (unless namestring
738        (error 'file-error        (error 'simple-file-error
739               :pathname file               :pathname file
740               :format-control "~S doesn't exist."               :format-control "~S doesn't exist."
741               :format-arguments (list file)))               :format-arguments (list file)))
742    
743      (multiple-value-bind (res err) (unix:unix-unlink namestring)      (multiple-value-bind (res err) (unix:unix-unlink namestring)
744        (unless res        (unless res
745          (error 'file-error          (error 'simple-file-error
746                 :pathname namestring                 :pathname namestring
747                 :format-control "Could not delete ~A: ~A."                 :format-control "Could not delete ~A: ~A."
748                 :format-arguments (list namestring                 :format-arguments (list namestring
# Line 766  Line 766 
766    "Return file's creation date, or NIL if it doesn't exist.    "Return file's creation date, or NIL if it doesn't exist.
767   An error of type file-error is signaled if file is a wild pathname"   An error of type file-error is signaled if file is a wild pathname"
768    (if (wild-pathname-p file)    (if (wild-pathname-p file)
769        (error 'file-error        (error 'simple-file-error
770               :pathname file               :pathname file
771               :format-control "Bad place for a wild pathname.")               :format-control "Bad place for a wild pathname.")
772        (let ((name (unix-namestring file t)))        (let ((name (unix-namestring file t)))
# Line 785  Line 785 
785   determined.  Signals an error of type file-error if file doesn't exist,   determined.  Signals an error of type file-error if file doesn't exist,
786   or file is a wild pathname."   or file is a wild pathname."
787    (if (wild-pathname-p file)    (if (wild-pathname-p file)
788        (error 'file-error        (error 'simple-file-error
789               :pathname file               :pathname file
790               "Bad place for a wild pathname.")               "Bad place for a wild pathname.")
791        (let ((name (unix-namestring (pathname file) t)))        (let ((name (unix-namestring (pathname file) t)))
792          (unless name          (unless name
793            (error 'file-error            (error 'simple-file-error
794                   :pathname file                   :pathname file
795                   :format-control "~S doesn't exist."                   :format-control "~S doesn't exist."
796                   :format-arguments (list file)))                   :format-arguments (list file)))
# Line 1216  Line 1216 
1216                         pathname))                         pathname))
1217           (created-p nil))           (created-p nil))
1218      (when (wild-pathname-p pathname)      (when (wild-pathname-p pathname)
1219        (error 'file-error        (error 'simple-file-error
1220               :format-control "Bad place for a wild pathname."               :format-control "Bad place for a wild pathname."
1221               :pathname pathspec))               :pathname pathspec))
1222      (enumerate-search-list (pathname pathname)      (enumerate-search-list (pathname pathname)
# Line 1233  Line 1233 
1233                                    namestring))                                    namestring))
1234                          (unix:unix-mkdir namestring mode)                          (unix:unix-mkdir namestring mode)
1235                          (unless (probe-file namestring)                          (unless (probe-file namestring)
1236                            (error 'file-error                            (error 'simple-file-error
1237                                   :pathname pathspec                                   :pathname pathspec
1238                                   :format-control "Can't create directory ~A."                                   :format-control "Can't create directory ~A."
1239                                   :format-arguments (list namestring)))                                   :format-arguments (list namestring)))

Legend:
Removed from v.1.43.2.1  
changed lines
  Added in v.1.43.2.2

  ViewVC Help
Powered by ViewVC 1.1.5