That's what my first code looked like, with the only difference being the QIODevice flag -- I used QIODevice::Append if the file already exists. It corrupts the file after several writes.

Thanks anyway.