[ ECLiPSe Stream I/O built-in.|Group Index| Full Index]

at_eof(+Stream)

Succeeds if the position of the pointer to stream Stream is at the end of file.

+Stream
Integer (stream number) or Atom (reserved or user-defined symbolic stream name).

Description

Used to test if the position of the pointer to stream Stream is at the end of file.

Stream can be a logical stream name or a physical stream number.

Fail Conditions

Fails if Stream is a file with its pointer not at end of file.

Resatisfiable

No.

Exceptions

(4) Instantiation fault
Stream is not instantiated.
(5) Type error
Stream is instantiated, but not to an atom or an integer.
(192)
Stream is an illegal stream mode.

Examples


Success:
      at_eof(null).

      [eclipse]: open(file1,write,s), at_eof(s),
      > write(hello,s), at(s,5), at_eof(s), close(s).
      yes.

Fail:

      [eclipse]: open(file1,write,s),write(hello,s), close(s),
      > open(file1,read,s), at_eof(s), close(s).
      no.

Error:
      at_eof(X).                  (Error 4).
      at_eof("s").                (Error 5).
      at_eof(input).              (Error 192).
      at_eof(output).             (Error 192).
      at_eof(error).              (Error 192).
      at_eof(debug_input).        (Error 192).


See Also

at / 2, seek / 2