lww pathname strangeness
I am calling a C dll from lispworks (lww 5.1) and it keeps failing because
_getcwd() returns the wrong pathname.
I've tracked this down to (change-directory ...). As soon as I use it, C's
_getcwd returns a string with "\\?\" prepended to it (looks like a
hostname!).
Does anybody know how to stop this from happening? (Is this a bug or a
feature?)
Here is a test that shows the problem (once per lisp session) on my W2K box:
(fli:define-foreign-function (getcwd "_getcwd" :source)
((buff (:pointer (:unsigned :char)))
(len :int))
:result-type (:pointer (:unsigned :char))
:language :ansi-c
:calling-convention :cdecl)
(defun test ()
(format t "~A~%" (fli:convert-from-foreign-string
(getcwd
(fli:convert-to-foreign-string (make-string
256 :initial-element #\*)
:null-terminated-p
t :external-format :ascii)
256)))
(change-directory (current-pathname))
(format t "~A~%"(fli:convert-from-foreign-string
(getcwd
(fli:convert-to-foreign-string (make-string
256 :initial-element #\@)
:null-terminated-p
t :external-format :ascii)
256))))
Thanks
pt