updated read command, no intermediate string, the file stream is immediately flushed