support for exit code from read

the exit code indicates if EOF (or other error) was reached