in reply to Both read and write to file

stevensw:

Generally you use seek to move the file descriptor to the specified location and perform your read or write. If you want to remember where you are in the file (so you can return to it later), use tell. The docs on seek will give you some example.code.

...roboticus

When your only tool is a hammer, all problems look like your thumb.