Finding the End of Line and End of File

To test whether the end of a line on the end of the file has been reached on the current or specified input stream, use at_end_of_line/[0,1] or at_end_of_file/[0,1].