Comment 6 for bug 1123267

Revision history for this message
Tyler Hicks (tyhicks) wrote : Re: [Bug 1123267] Re: File goes missing for a short period of time after saving it using VIM

On 2013-02-13 12:51:04, Michael P. Jung wrote:
> I'm starting to disbelieve myself. I wrote a simple C program that
> renames a file, creates a new one and forks a new process which tries to
> read the newly created file. It works just fine.

Well according to the strace, vim does remove the file for a moment:

rename("x", "/home/bikeshedder/.vimbackup/x~") = 0
fsync(4) = 0
open("x", O_WRONLY|O_CREAT|O_TRUNC, 0664) = 3

That doesn't seem like the right thing to do to me, but that would be a bug in
vim.

I'm not familiar with how the auto reloader works, but there's a chance that it
could try to open "x" in the small amount of time that vim renamed "x" to "x~"
and hasn't yet recreated "x".

This may be only seen by you on eCryptfs because it is a little slower than
traditional filesytems.