I am having trouble running examples from the Verrazano test suite in
sbcl 0.9.9, and I have isolated the problem to the following error:
(with-open-file (out (merge-pathnames "vzntemp.cpp"
(make-pathname :device "/"
:directory "/tmp"))
:direction :output
:if-exists :supersede)
(format out "~a~%" "this is a test"))
-->
The path #P"//tmp/vzntemp.cpp" does not exist.
[Condition of type SB-INT:SIMPLE-FILE-ERROR]
Restarts:
0: [ABORT-REQUEST] Abort handling SLIME request.
1: [TERMINATE-THREAD] Terminate this thread
However,
(with-open-file (out #P"//tmp/vzntemp.cpp"
:direction :output
:if-exists :supersede)
(format out "~a~%" "this is a test"))
works just fine.
What is going on?
Matt
--
"You do not really understand something unless you can
explain it to your grandmother." — Albert Einstein.
Matthew D Swank <·······································@c.net> writes:
> I am having trouble running examples from the Verrazano test suite in
> sbcl 0.9.9, and I have isolated the problem to the following error:
>
> (with-open-file (out (merge-pathnames "vzntemp.cpp"
> (make-pathname :device "/"
> :directory "/tmp"))
> :direction :output
> :if-exists :supersede)
> (format out "~a~%" "this is a test"))
>
> -->
> The path #P"//tmp/vzntemp.cpp" does not exist.
> [Condition of type SB-INT:SIMPLE-FILE-ERROR]
>
> Restarts:
> 0: [ABORT-REQUEST] Abort handling SLIME request.
> 1: [TERMINATE-THREAD] Terminate this thread
>
> However,
>
> (with-open-file (out #P"//tmp/vzntemp.cpp"
> :direction :output
> :if-exists :supersede)
> (format out "~a~%" "this is a test"))
>
> works just fine.
>
> What is going on?
It may be that "//tmp/vzntemp.cpp" is being parsed into some different
pathname structure than the one you explicitly specified. For
instance, what is:
(pathname-device #p"//tmp/vzntemp.cpp") ==> ???
On Allegro on OS X, it returns :UNSPECIFIC. And
(equal #p"//tmp/vzntemp.cpp" #p"/tmp/vzntemp.cpp") ==> T
which suggests the extra leading #\/ is being ignored. My guess is the
same thing is happening in SBCL.
-Peter
--
Peter Seibel * ·····@gigamonkeys.com
Gigamonkeys Consulting * http://www.gigamonkeys.com/
Practical Common Lisp * http://www.gigamonkeys.com/book/
On Fri, 10 Feb 2006 14:31:45 +0000, Peter Seibel wrote:
> (pathname-device #p"//tmp/vzntemp.cpp")
This is nil in sbcl, and using that as the device, (or omitting the device
argument altogether) seems to work.
Thanks,
Matt
--
"You do not really understand something unless you can
explain it to your grandmother." — Albert Einstein.
Peter Seibel <·····@gigamonkeys.com> writes:
> On Allegro on OS X, it returns :UNSPECIFIC. And
>
> (equal #p"//tmp/vzntemp.cpp" #p"/tmp/vzntemp.cpp") ==> T
>
> which suggests the extra leading #\/ is being ignored. My guess is the
> same thing is happening in SBCL.
Don't some systems (perhaps POSIX systems) give different sematics
to "//path" vs. "/path"?
--
__Pascal Bourguignon__ http://www.informatimago.com/
THIS IS A 100% MATTER PRODUCT: In the unlikely event that this
merchandise should contact antimatter in any form, a catastrophic
explosion will result.