Marc Liu
September 20th, 1999, 04:49 PM
Any suggestions on how to read lines from a file then delete them?
I want to open a file, read sequential lines from the file and then delete them from the file. This would cause successive calls to the application to decrease the size of the file. For example, if I read lines 1-20, upon sucessful completion, line 21 would become line 1, line 22 would become line 2, etc. etc. So far the only method I can think of is to read the desired lines, then read in the rest of the file and re-write the original file. Any help would be appreciated. Thanks.
M. Liu
I want to open a file, read sequential lines from the file and then delete them from the file. This would cause successive calls to the application to decrease the size of the file. For example, if I read lines 1-20, upon sucessful completion, line 21 would become line 1, line 22 would become line 2, etc. etc. So far the only method I can think of is to read the desired lines, then read in the rest of the file and re-write the original file. Any help would be appreciated. Thanks.
M. Liu