It could be because you are using the
>> operator in the open statement.
>> means append and that's why it's alway showing at the end. I would open the file, read in the contents, then re-write the same file or write to another file that you could do the corruption testing on.
Rich36
There's more than one way to screw it up...