Yeah, you are right but keep in mind it's not a real program and also file contains a small string. The purpose of posting this topic here was to find a sulotion for that a simple exercise.
And about positioning: I don't remember I have said how to solve this probelm using positioning. I talked about file open modes.