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...

-- 
Micro$oft: where do you want to go today?
    Linux: where do you want to go tomorrow?
  FreeBSD: are you guys coming, or what?

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

Reply via email to