[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



Is there a way to test for an end-of-file condition with fixnum files.
I would very much like it if all the i/o functions had somewhat similar
syntax. It seems there is no way to do with FILEPOS, IN, and a few other
random functions what you can do with read (ie, specify a last arg which
is the value returned if an EOF is hit.) There also needs to be a seperate
function (EOF?) which takes the arg of a file object and tells you if you
are about to get an EOF condition. If such a function is not included there
is a problem writing efficient code. One would like to be able to declare
a variable (say N) to be fixnum and do a (SETQ N (IN <stream> <lossage-thing>))
but since N can return any fixnum, you will always stand to lose somehow.
the alternative is to allow <lossage-thing> to be NIL but then you can't
declare N to be a fixnum. the (EOF <stream>) is the only clean way to resolve
the problem. [Note that when I say <stream> I mean a disk file -- though
it would be nice if we had streams, I use the term stream here just becuz
it is shorter than file-object, and I'm in the habit of calling files streams
for convenience.]