Re: Wrong return value from ensure-directories-exist

Gary Byers <[email protected]> Mon, 7 Jul 2003 04:14:11 -0600 (MDT)
Newsgroups gmane.lisp.openmcl.bugs
Message-ID <[email protected]>
Thanks; your fix is in CVS.


On Sat, 5 Jul 2003, Harald Hanche-Olsen wrote:

> The following behaviour is wrong:
>
> ? (ensure-directories-exist "/tmp/foo/bar.zip")
> #P"/tmp/foo/"
> T
>
> The first value returned should be the pathspec given as input to
> ensure-directories-exist, not that of the directory created.  This is
> so that you can say, e.g.,
>
> (open-file (ensure-directories-exist "/tmp/foo/bar.zip")
>            :direction :output)
>
> - which, incidentally, is how I discovered the bug.
>
> Fortunately, this is easy to fix:
>
> --- ccl/lib/pathnames.lisp.ORIG	Sun Apr  6 22:48:24 2003
> +++ ccl/lib/pathnames.lisp	Fri Jul  4 20:12:08 2003
> @@ -211,7 +211,7 @@
>  			      :pathname namestring
>  			      :error-type "Can't create directory ~S."))
>  		     (setf created-p t)))))
> -      (values pathname created-p))))
> +      (values pathspec created-p))))
>
>  (defun dirpath-to-filepath (path)
>    (setq path (translate-logical-pathname (merge-pathnames path)))
>
> Please Cc any responses to me, I am not on the list.
> (Hmm, maybe I should subscribe, but not until I am back from a trip.)
>
> - Harald
>
> _______________________________________________
> bug-openmcl mailing list
> [email protected]
> http://clozure.com/cgi-bin/mailman/listinfo/bug-openmcl
>
>