path



Raymond Toy <toy.raymond at gmail.com> writes:

>>>>>> "Leo" == Leo Butler <l_butler at users.sourceforge.net> writes:
>
>     Leo> Raymond Toy <toy.raymond at gmail.com> writes:
>     >>>>>>> "Leo" == Leo Butler <l_butler at users.sourceforge.net> writes:
>     >> 
>     Leo> How about the following:
>     >> 
>     Leo> :lisp (defun $directory_part (pathname) ($printf nil "/~a" (apply #'combine-path (rest (pathname-directory pathname)))))
>     >> 
>     Leo> Now, in your batch file you can access the directory name via:
>     >> 
>     Leo> dirname : directory_part(load_pathname);
>     >> 
>     >> Look at pathname_directory; I think it does what your $directory_part
>     >> does.
>
>     Leo> I did, and with sbcl at least, pathname_directory barfs on a string
>     Leo> input. I guess you consider that a bug?
>
> Yes, I would consider that a bug.  But pathname_directory is defined
> as:
>
> (defun $pathname_directory (path)
>   (let ((pathname (pathname path)))
>     (namestring (make-pathname :directory (pathname-directory pathname)))))
>
> so strings are perfectly acceptable since PATHNAME converts a string
> to a pathname object.
>
> Something else is going on.
>
> With cmucl and ccl,
>
> pathname_directory("/tmp/foo") -> "/tmp/"
>
>
> Ray

Ok, I had exited my previous Maxima session and now with a new one I
cannot reproduce the error message. But, the message I was seeing was a
type error indicating that pathname_directory did not consider a string
a valid argument to pass. 

If I see this again, I will post it as a follow-up.

-- 
Leo Butler                      leo.butler at member.ams.org
SDF Public Access UNIX System -   http://sdf.lonestar.org