Let's say I'm writing to a file a series of integers like this:
4
3
2
1
0

After writing the last number (or the last line), can I delete that last one?

Recommended Answers

All 3 Replies

Do not write the line in the first place and you do not have to delete it. :)

Do not write the line in the first place and you do not have to delete it. :)

But I really wanna know how to delete the last line!:twisted:

But I really wanna know how to delete the last line!

Then make a new file, copy only the content you need from the first one, delete the first file, and rename the second file.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.