This is bad !
If the new text is shorter than the old one, the file is not truncated, and you happen to have some extra dirt at the end of the file !
(took me quite some time to figure it out)
P!
Are the monkeys gone yet?
Comment on Re^2: Modify file without any temp variable