[Cl-darcs-cvs] r184 - cl-darcs/trunk

mhenoch at common-lisp.net mhenoch at common-lisp.net
Tue Apr 1 22:00:18 UTC 2008


Author: mhenoch
Date: Tue Apr  1 17:00:17 2008
New Revision: 184

Modified:
   cl-darcs/trunk/upath.lisp
Log:
Add TRUENAME argument to MAKE-UPATH


Modified: cl-darcs/trunk/upath.lisp
==============================================================================
--- cl-darcs/trunk/upath.lisp	(original)
+++ cl-darcs/trunk/upath.lisp	Tue Apr  1 17:00:17 2008
@@ -20,14 +20,18 @@
 ;; file.  For local files, just use pathnames.  For remote files, use
 ;; the PURI library.  (Or the real thing, if we're using ACL)
 
-(defun make-upath (path)
+(defun make-upath (path &key truename)
   "Turn PATH into a \"universal pathname\".
 If PATH is a pathname or URI, return it unchanged.
 If PATH starts with \"http://\" or \"https://\", return a URI.
-Else, return a pathname."
+Else, return a pathname.
+
+If TRUENAME is provided and true, give an absolute path."
   (ctypecase path
     (pathname
-     path)
+     (if truename
+	 (truename path)
+	 path))
     (net.uri:uri
      path)
     (string
@@ -36,7 +40,9 @@
 	     (and (>= (length path) 8)
 		  (string= path "https://" :end1 8)))
 	 (net.uri:parse-uri path)
-	 (pathname path)))))
+	 (if truename
+	     (truename (pathname path))
+	     (pathname path))))))
 
 (defun upath-subdir (base subdirs &optional filename)
   "From BASE, descend into SUBDIRS and FILENAME.



More information about the Cl-darcs-cvs mailing list