[Tutor] How to delete the last line from a file efficiently?
zhuchunml at gmail.com
Thu Feb 18 10:30:48 CET 2010
Now I have a text file about 1MB. Sometimes I need to remove the last
The current method I use is reading all content, finding the last
sentence, remove it and write the new content to the file.
So, it need to read a 1MB file and write a 1MB file. It's ineffictient,
I think. Are there any other methods?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor