An 'error' is not necessarily a compiler error - it's a general term for anything that your program is doing that you don't want it to or anything that it's not doing that you do want it to.
To clarify, my understanding right now is that you're wanting to:
- read a value from a file
- store that value in memory
- change the value in the file (while still holding the original value in memory)
- close the file
- re-open the file later
- restore the original value