EndOfFile
EndOfFile is a symbol returned by Read when it reaches the end of a file.
Examples
Read until end of file:
While[(line = Read[stream, String]) =!= EndOfFile,
Print[line]]Check for end of file:
Read[stream] === EndOfFilePlease visit the official Wolfram Language Reference for more details.