Wednesday, June 22, 2011

Re: Error with :.! commands

Hi Gary!

On Mi, 22 Jun 2011, Gary Johnson wrote:

> On 2011-06-22, Ben Fritz wrote:
> > On Jun 22, 2:41 pm, Chandra wrote:
> > > Hello,
> > >     I see the following error when I try to in-line execute a shell
> > > command something like
> > >
> > > :.!grep foo bar
> > >
> > > "/tmp/v454263/17" E212: Can't open file for writing
> > > E482: Can't create file /tmp/v454263/17
> > >
> > > It usually happens if the vim session has been on for a long time
> > > without ever closing and reopening vim.
> > > A fresh vim session does not give this error. Any idea what happens
> > > here?
> > >
> >
> > Possibly the temp directory got deleted out from under you. I'm not
> > sure of a good way around this.
>
> When I've run into this I've just recreated the directory, e.g.,
>
> :!mkdir /tmp/v454263

Yeah, that is the only way around it. Some time ago, I made a patch
(http://groups.google.com/group/vim_dev/browse_frm/thread/728829f95c9ee28a/5d65508d4e21316a?lnk=gst&q=patch+temp+dir#5d65508d4e21316a)
that would make Vim check first, whether the directory still exists and
would create a new one, if it doesn't, but Bram didn't want to include
it.

Hm, I wonder whether one could catch E482 or E483 globally and try to
recreate the missing directory.

regards,
Christian

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: