Lisp HUG Maillist Archive

Confused abouth pathnames

CL-USER 93 > (get-working-directory)
#P"C:/Documents and Settings/John Thingstad_2/"

CL-USER 94 > (pathname-device *)
NIL

What? Don't you mean C?

CL-USER 95 > (pathname-directory **)
(:ABSOLUTE "Documents and Settings" "John Thingstad_2")

OK No device..

CL-USER 96 > (make-pathname :device "C" :directory "Windows")
#P":C:/Windows/"

What's that extra : doing there?

(let ((dir (get-working-directory)))
   (defparameter *app-help-directory*
     (make-pathname
      :device "C"
      :directory (pathname-directory dir))))

(defun app-help (subject)
   (let ((file-name (merge-pathnames
                     (make-pathname :name subject :type "txt")
                     *app-help-directory*)))
     (write file-name)
     (with-open-file (file file-name :direction :input)
       (loop for text = (read-line file nil 'eof)
             until (eq text 'eof) do
             (write-line text)))
     (values)))

CL-USER 97 > (app-help "input")
#P":C:/Documents and Settings/John Thingstad_2/input.txt"
Error: The file #P"C:C:/Documents and Settings/John Thingstad_2/input.txt"  
does not exist.

Who added that extra C: ?

Is pathname broken under windows?

In ACL I get

(make-pathname :devive "C" :directory "Windows")
> #p"C:\\Windows"

about like I would expect.

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


Re: Confused abouth pathnames

On Mon, 04 Dec 2006 23:04:03 +0100, "John Thingstad" <john.thingstad@chello.no> wrote:

> CL-USER 93 > (get-working-directory)
> #P"C:/Documents and Settings/John Thingstad_2/"
>
> CL-USER 94 > (pathname-device *)
> NIL
>
> What? Don't you mean C?

Try PATHNAME-HOST.


Updated at: 2020-12-10 08:47 UTC