How to add to the beginning of a text flag in g ++

I want to write to a file without overwriting anything. This is a text file containing entries. When I delete a specific record, I actually do not delete it from the file, I just put the information in the header, saying that it is deleted. How can i do this?

+3
source share
2 answers

You cannot add a file to the BEGINNING without overwriting it from scratch. It should go at the end (which makes sense, since it means the word "add").

If you want to be able to mark the deleted record without leaving space for this flag, you need to place information at the end or rewrite everything.

, - , "" .

+2

, (, - , , ):

(, # deleted # # 000, # , ).

, ; , , .

, , , , , - "" .

, ( ) , , , - .

0

Source: https://habr.com/ru/post/1738792/


All Articles