28.11.2014, 22:26
Quote:
Just can't just remove the last line from a file.
You could read the file, line by line, and write each line to a second file and skip the last line. Then delete the first (original) file and rename the second file to the original filename. Or create an array big enough to read the entire file at once, overwrite the file with the data in the array but skip the last line. |