I save in a file some info about users (like number of times user passed the login page, last visited time, and so on).
I want to read this info from the file, and update it (add 1 to the counter, and change the last visited time).
My question is: can I do it without opening the file twice ?
I open the first time to read the contents, and then open it again to overwrite the contents with the updated ones.
Thanks !