You'll need to read the file, write it to another file except the last
line and then copy it over to the original. When it's a small file you
could read it into memory and just rewrite the existing file save the
last line.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.