On Oct 13 21:16, Bram Moolenaar wrote:
> Corinna Vinschen wrote:
> 
> > I got a report on the Cygwin mailing list that the following message
> > appears when trying to open /etc/hosts in vim:
> > 
> >   E303: Unable to open swap file for "/etc/hosts", recovery impossible
> > 
> > What happens is this:
> > 
> > /etc/hosts is by default a symbolic link which points to the hosts file
> > in the Windows system directory.  The symbolic link is created as a link
> > to the DOS path, for instance:
> > 
> >   $ ls -l /etc/hosts
> >   lrwxrwxrwx 1 corinna None 37 Oct 13 18:32 /etc/hosts -> 
> > c:\WINDOWS\system32\drivers\etc\hosts
> > 
> > By stracing vim I found that vim was trying to create a swap file
> > called "/tmp/c:\WINDOWS\system32\drivers\etc\hosts".
> > 
> > Cygwin is mostly treated as Unix target in vim, which is basically
> > correct.  However, since Cygwin allows POSIX paths as well as DOS paths,
> > there are both types of absolute paths.
> > 
> > Below is a patch which works for me, though I'm not sure if it's
> > complete enough to catch all cases.  There's code for OS2 in os_unix.c
> > which I reused, plus a new definition in mch_isFullName for the absolute
> > path on Cygwin.
> > 
> > I'd be grateful if the below or a more feasible patch which solves the
> > above problem, could be applied to vim.
> 
> I think this fixes only one specific problem.  When Vim is compiled for
> Unix it does not recognize DOS paths.  And that matters in many places
> (e.g., search for CASE_INSENSITIVE_FILENAME and BACKSLASH_IN_FILENAME).
> Also behavior of a backslash in a file name changes.  Making Vim for
> Unix handle these things will be an awful lot of work...

True enough.  But maybe fixing these problems as they turn up might
be a helpful approach?  Anyway, what's noticable here is the fact
that this is a new problem in vim 7.  It wasn't present in vim 6.4
so it is a regression.


Corinna

-- 
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat

Reply via email to