You shouldn't open a writer on top of the same file you are reading.  The writer may have just truncated the file, making it impossible to read later sections of the same file.  This is one reason we use LockFile in a lot of the code, because it writes to a temporary file alongside of the original, and then does a rename during commit.