OK, figured it out, and it was my coding at fault.
What was happening was I was reading the file until eof, when fstream hits end of file it sets the eof bit and the fail bit.
Once the fail bit is set, no operations on the file will succeed until the failbit is cleared.
The modified code...