I have a log file generated by my program, one of the options is a maximum size for the log file. What I need to be able to do is append my new log entry then check the file size. If the file size is too large remove a chunk of it.
I know that I CAN simply make a temp file write only the info I want there, then erase the original file and replace it with the temp. but I don't want to do that.
How can I remove X amount of data from the start of the file without creating another file?