I have a large text file.
Each time my program starts, it should be read in the first line, delete it and put this data in the bottom of the file.
Is there a way to accomplish this task without reading in every part of the file?
It would be great to follow this pseudo-code example:
1. Open file stream for reading/writing
2. data = first line of file
3. remove first line from file <-- can I do this?
4. Close file stream
5. Open file stream for appending
6. write data to file
7. Close file stream
I try to avoid reading everything because the program runs at a specific time every day. I do not want the delay longer each time the file gets larger.
All solutions found require the program to process the entire file. If C ++ filestreams cannot accomplish this, I am ready for any alternative that is fast and efficient for my C ++ program.
thank.