[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Questions about OPEN
Date: Wed, 3 Oct 84 08:26 EST
From: Robert (LISPer 68K)Heller <email@example.com>
I have some questions about what the function OPEN returns if
:DIRECTION is :PROBE:
1) if the file exists, does OPEN return a closed stream?
Well, it returns a stream that doesn't support any I/O operations, just things
like file-write-date, file-author, file-length, and truename. This could be
implemented as a special kind of stream or as a closed stream.
Interestingly enough, the manual says that each of those four functions
is only allowed for an open stream. Presumably this means to imply that you
cannot use them on a stream returned by a probe-open. This in turn implies
that probe-open might as well have been defined to return simply true or
I contend that :direction :probe should never have been put into Common Lisp
and only the probe-file function ought to exist. In some implementations,
ours for instance, probe-file is implemented by calling open with the
:direction :probe option, but I think that is an internal interface, not
something that should be visible in the Common language.
On the other hand, in some file systems the write-date, author, length,
and truename cannot be determined for an output file until the file is
closed, because the file system assigns them at that time. This
suggests that it was a mistake for the manual to require that the stream
passed to these functions be open. They ought to accept a stream that
resulted from probe-open and also a stream that has been closed with the
2) if the file does not exist and :IF-DOES-NOT-EXIST is
:CREATE, what does OPEN do? create an empty and return a
We signal an error for an illegal combination of options. I can't tell
whether the manual rules that out or not.
Is Guy, or anyone, still recording possible ambiguities or errors in the
manual for later correction? I don't plan to follow this up myself.