jeromejj / vim

Automatically exported from code.google.com/p/vim
0 stars 0 forks source link

Temporary file creation non-comprehensively fails when all the variations are taken for the name #368

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am always getting this even if I remove that file: E138: Can't write viminfo 
file /home/lpapp/.viminfo!

After a lot of fiddling with chmod/chown/rm as suggested by some Google search 
results, I noticed that they had not helped me with this. Thereby, I went for 
running vim through strace!

I do not know why, but I ended up having the following files:

-rw-r--r-- 1 lpapp admin     0 May 22 18:48 /home/lpapp/.viminfa.tmp
-rw------- 1 lpapp admin 22541 May 15 18:00 /home/lpapp/.viminfb.tmp
-rw------- 1 lpapp admin     0 May 20 18:47 /home/lpapp/.viminfc.tmp
-rw------- 1 lpapp admin 12288 May 12 20:04 /home/lpapp/.viminfd.tmp
-rw------- 1 lpapp admin 20480 May 12 20:04 /home/lpapp/.viminfe.tmp
-rw------- 1 lpapp admin     0 May  1 19:41 /home/lpapp/.viminff.tmp
-rw------- 1 lpapp admin 16384 Apr 13 11:23 /home/lpapp/.viminfg.tmp
-rw------- 1 lpapp admin     0 Apr 13 11:23 /home/lpapp/.viminfh.tmp
-rw------- 1 lpapp admin     0 Apr  2 20:38 /home/lpapp/.viminfi.tmp
-rw------- 1 lpapp admin     0 Mar  6 12:23 /home/lpapp/.viminfj.tmp
-rw------- 1 lpapp admin     0 Mar  4 20:32 /home/lpapp/.viminfk.tmp
-rw------- 1 lpapp admin 12428 Mar  4 11:28 /home/lpapp/.viminfl.tmp
-rw------- 1 lpapp admin     0 Mar  3 19:00 /home/lpapp/.viminfm.tmp
-rw------- 1 lpapp admin 12218 Mar  2 20:28 /home/lpapp/.viminfn.tmp
-rw------- 1 lpapp admin   744 May 26 12:05 /home/lpapp/.viminfo
-rw------- 1 lpapp lpapp     0 Jan 23 08:59 /home/lpapp/.viminfo.tmp
-rw------- 1 lpapp admin 10841 Feb 27 19:02 /home/lpapp/.viminfp.tmp
-rw------- 1 lpapp admin  8497 Feb 26 20:44 /home/lpapp/.viminfq.tmp
-rw------- 1 lpapp admin 11327 Feb 26 13:18 /home/lpapp/.viminfr.tmp
-rw------- 1 lpapp admin  9271 Feb 24 17:26 /home/lpapp/.viminfs.tmp
-rw-r--r-- 1 lpapp admin 14192 Feb 24 17:26 /home/lpapp/.viminft.tmp
-rw------- 1 lpapp admin 14931 Feb  6 20:14 /home/lpapp/.viminfu.tmp
-rw------- 1 lpapp lpapp 19035 Feb  3 20:43 /home/lpapp/.viminfv.tmp
-rw------- 1 lpapp admin     0 Jan 28 20:25 /home/lpapp/.viminfw.tmp
-rw------- 1 lpapp admin     0 Jan 26 19:01 /home/lpapp/.viminfx.tmp
-rw------- 1 lpapp lpapp  4096 Jan 21 20:13 /home/lpapp/.viminfy.tmp
-rw------- 1 lpapp admin  8192 Jan 20 19:02 /home/lpapp/.viminfz.tmp

vim tries to merge the existing .viminfo with what it is writing, so it tries 
to create a temporary file. However, it will not override the existing 
temporary files. Therefore, it will try to find a name, but it will not succeed 
as all the possible options are taken, already.

The way to fix this is: rm ~/.viminf*.tmp, but I only figured this out using 
strace. It would have been much better if vim could report the exact issue 
right away.

Original issue reported on code.google.com by lpapp.b...@gmail.com on 26 May 2015 at 12:38

Attachments:

GoogleCodeExporter commented 9 years ago
Note, you can always get help for each error number. And there you'll see:

,----[ :h E138 ]-
|     When you get error "E138: Can't write viminfo file"
|     check that no old temp files were left behind (e.g.
|     ~/.viminf*) and that you can write in the directory of
|     the .viminfo file.
`----

Therefore closing.

Original comment by chrisbr...@googlemail.com on 4 Jun 2015 at 9:03