File goes missing for a short period of time after saving it using VIM
This bug started as a question on unix.stackexcha
I am having a strange problem that seams to be caused by VIM, the Linux VFS cache, ecryptfs and/or something file system related:
1. I open a file in VIM, modify it and save it.
2. I try to access the file.
The file should be accessible as soon as :w reports the file as written.
The file does not exist.
If I wait a bit (usually less then a second) the file turns up.
This is especially cumbersome when working with Python code and left over pyc files. I often ended up starting the old code as the new py file was not ready, yet. I recently added export PYTHONDONTWRITE
##System details and configuration
My machine has plenty of RAM (32 GiB), an SSD and is basicly idle. Therefore I do not think that slow I/O is causing this. The file is very small (<1 KiB) and it also happens for empty files. I am using a crypted $HOME using ecryptfs so this might be part of the problem. I was unable to reproduce this on my /tmp mount which uses a tmpfs file system.
The reason why the file is moved away and replaced by a new file is caused by my VIM settings:
I would expect the new file to be accessible right after VIM reports that the file has been written. I checked the VIM documentation for any hints of a delayed write, but did not find anything. I was unable to reproduce this using the shell commands mv, cp and rm so I think VIM is doing something different.
##Distribution and software versions
I'm running Ubuntu GNU/Linux 12.10 x86_64 with ecryptfs-utils 100.
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.10
$ uname -a
Linux blackhole 3.5.0-22-generic #34-Ubuntu SMP Tue Jan 8 21:47:00 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
$ apt-cache show ecryptfs-utils |grep Version
|Tyler Hicks (tyhicks) wrote : Re: [Bug 1123267] Re: File goes missing for a short period of time after saving it using VIM||#4|