xfs
[Top] [All Lists]

Re: vim file write mode on journaling fs.

To: Seth Mos <knuffie@xxxxxxxxx>
Subject: Re: vim file write mode on journaling fs.
From: Bram Moolenaar <Bram@xxxxxxxxxxxxx>
Date: Fri, 10 Aug 2001 21:58:48 +0200
Cc: Linux XFS Mailing List <linux-xfs@xxxxxxxxxxx>
In-reply-to: <Pine.BSI.4.10.10108102045310.24753-100000@xs3.xs4all.nl>
Sender: owner-linux-xfs@xxxxxxxxxxx
Seth Mos wrote:

> One sync exit wouldn't make that much of difference, You can only exit a
> program once :-)

You wouldn't want to sync the whole disk, just the files that Vim wrote.
Would require remembering which files were written.  And you would want the
sync to happen when Vim doesn't exit anyway.  No, if the syncing is to be
done, it's better to do it immediately when the file was written.

> > I wonder why the swap file wasn't deleted.  Vim must have deleted it, and
> > if the metadata for the text file was flushed, why wasn't the swap file
> > metadata flushed?
> 
> I don't know but the swapfile had not the changes but was a exact copy of
> the same file.

Do you mean after recovery, or did you look in the swapfile itself?  When Vim
overwrites the original file, the swap file is flushed, because it can't use
the original file to recover from then.  That does create overhead, I don't
see how that can be avoided.  In this case it indeed helps to recover your
text.

> The thing is that the only application that people have managed to
> produce NULL character files with so far has been vim :-/
> If I edit a file with pico it is in one piece if I save it. I will
> scavenge the pine sources to see what pico is doing.

Does it only happen when overwriting an existing file?  I would expect the
same to happen when writing a new file.  E.g. when using:

        cp file1 file2
        rm file1

Could you end up with an invalid file2 while file1 has been deleted already?

-- 
ARTHUR:  I am your king!
WOMAN:   Well, I didn't vote for you.
ARTHUR:  You don't vote for kings.
WOMAN:   Well, 'ow did you become king then?
                                  The Quest for the Holy Grail (Monty Python)

 ///  Bram Moolenaar -- Bram@xxxxxxxxxxxxx -- http://www.moolenaar.net  \\\
(((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
 \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///


<Prev in Thread] Current Thread [Next in Thread>