home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / lisp / 2425 < prev    next >
Encoding:
Text File  |  1992-09-14  |  1.3 KB  |  33 lines

  1. Newsgroups: comp.lang.lisp
  2. Path: sparky!uunet!stanford.edu!lucid.com!karoshi!york
  3. From: york@oakland-hills.lucid.com (Bill York)
  4. Subject: Re: changing the pathname type
  5. In-Reply-To: haltraet@monsun.si.no's message of Mon, 14 Sep 1992 08:12:47 GMT
  6. Message-ID: <YORK.92Sep14111244@oakland-hills.lucid.com>
  7. Sender: usenet@lucid.com
  8. Reply-To: York@Lucid.COM
  9. Organization: Lucid, Inc.
  10. References: <HALTRAET.92Sep14091247@monsun.si.no>
  11. Date: 14 Sep 92 11:12:44
  12. Lines: 19
  13.  
  14. In article <HALTRAET.92Sep14091247@monsun.si.no> haltraet@monsun.si.no (Hallvard Tr{tteberg) writes:
  15.  
  16.    I would like to change the filetype of a pathname (e.g. to nil
  17.    (unspecified) or .lisp). There is no (setf pathname-type) in my lisp,
  18.    nor is it mentioned in CLtL, although pathname-type is called an
  19.    accessor. I cannot use (merge-pathnames <filename> ".lisp") since this
  20.    will only "change" the pathname-type if it is nil (unspecified). I
  21.    cannot merge the other way, i.e. (merge-pathnames ".lisp" <filename>)
  22.    since I would like to use nil (unspecified) instead of ".lisp". I want
  23.    to avoid doing string-search since it would likely be non-portable.
  24.  
  25. You can use make-pathname, specifying the type explicitly and
  26. defaulting everything else from the original pathname.
  27.  
  28. > (make-pathname :type nil :defaults #P"/foo/bar.lisp")
  29. #P"/foo/bar"
  30. > (pathname-type *)
  31. NIL
  32.