in reply to Inplace without backup uses no extra disk space?
Windows doesn't allow(*) you to delete an open file. So yes, it is required that you create a backup in order to use -i.
However, editing a file in-place isn't that hard to program, even if you need to delete and/or add to the file--provided you only need to process the file serially. Ie. from the beginning to the end, record by record.
The trick is to maintain an in-memory buffer sufficient to ensure that you don't try to overwrite a part of the file before you've read it. If the aggregate additions amount to more than can be held in memory, then using a spill file as the buffer is a little more complex.
Do you have some estimate of the volume of edits/deletions/insertions required?
That said, disks are cheap. The first UK ad google found offered 500GB for £32.
Another approach would be to write the file to a CD/DVD; delete it from the disk; then read it from the optical drive and write to the disk.
(*)It may be possible using obscure backup APIs and special privileges, but that should be considered a very last resort.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Inplace without backup uses no extra disk space?
by bellaire (Hermit) on Feb 02, 2010 at 14:27 UTC | |
by BrowserUk (Patriarch) on Feb 02, 2010 at 14:53 UTC | |
by marto (Cardinal) on Feb 02, 2010 at 15:18 UTC | |
by bellaire (Hermit) on Feb 02, 2010 at 18:29 UTC | |
by marto (Cardinal) on Feb 02, 2010 at 18:41 UTC |