>>>>> "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