unlink() history file after opening it
unlink() removes file entry from filesystem. Since the file is already opened, it will still be available for reading and writing. This guarantees the file won't remain in filesystem after process termination, even when there was a crash.
Edited by Nate Graham