flush the file stream before attemping to read.