I save some information about users in the file (for example, the number of times the user went through the login page, time of the last visit, etc.).
I want to read this information from a file and update it (add 1 to the counter and change the last time I visited).
My question is: can I do this without opening the file twice?
I open it for the first time to read the content, and then open it again to overwrite the contents with the updated ones.
Thank!
source
share