I am trying to understand keylogger code (for ethical hacking) on YouTUBE
But I cannot understand the purpose of
- Opening outputfile for reading
- Saving to buffer
- Closing the outputfile
- Opening the outputfile for writing
- Save all log information as a variable
Why not simply open writable file and then close when the program terminates?
What is the logic to the above approach? Is there some sort of best practice? Please clarify
