Am 29.11.2009 18:16, schrieb Michael Scheper:
> G'day everyone,
>
> I've been fruitlessly searching for documentation on the format of vim
> swap files. Does anybody have a link for that? All I want is a way to
> tell whether the swap file is for a file that's been modified. It
> seems that most of the time, swap files for modified files start with
> an uppercase 'U', but this isn't an entirely reliable indicator.
>
> Thanks,
> MS.

My swap files start with "b0VIM 7.2".  When I edit a file for which a
swap file exists, I get

E325: ATTENTION
Found a swap file ...
     dated ...
     file name ...
     modified: YES       <-- (!)
     ...

So Vim informs me about the last 'modified' state (= state just before
the session was interrupted).

You are right about the 'U': Vim's source code confirms that a magical
'U' character (0x55) at position 0x000003EF in the swap file indicates
the 'modified' state (0x00 otherwise).  (see memfile.c, struct block0)

-- 
Andy

-- 
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

Reply via email to