On Mon, Mar 9, 2009 at 8:28 AM, Chetan S cshring@gmail.com wrote:
On Mon, Mar 9, 2009 at 1:46 PM, sachin puri readsachin@gmail.com wrote:
I wish to know why does vim create a new file in case 1. Wouldn't it be a costly operation, especially in case of large files?
Not really if the swap file only records the changes / operations to the original in the swap. A la' journal if you will.
When (how often) does vim write out the swap file?
In short, which method is more efficient to implement for any file editor?
Depends on the files you are trying to edit.
However here's a strategy you can consider -
- Start a journal for an edit session
- Flush the journal every couple of seconds ( autosave ? )
Where this would fail is if the crash happens while flushing the journal. Then you would require a meta-journal .... :P
May the editor-makers on the list enlighten us on more strategies please !
regards, C -- http://mm.glug-bom.org/mailman/listinfo/linuxers