in reply to Help in read and write to file at a same time in same file.
In reality it looks like this (try od -xc if you are in UNIX):This is a line This is another line and so is this
Adding a # to the second line, and then rewriting it, would give us this (look carefully):This is a line\nThis is another line\nand so is this\n
Adding an extra character makes the line longer, so it overwrites the first character of the next line!This is a line\n#This is another line\nnd so is this\n
|
|---|