X-Spam-Check-By: sourceware.org
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain; 	charset="us-ascii"
Subject: RE: vim 7 gives error when editing /etc/hosts
Date: Tue, 13 Jun 2006 09:32:49 -0400
Message-ID: <C874DBE9D30B584587F8CD0EC34DA8BE01C6DAEC@EX00.idirect.net>
From: "Harig, Mark" <maharig@idirect.net>
To: "Frank Fesevur" <ffes@users.sourceforge.net>, <cygwin@cygwin.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id k5DDYhD3001489

> -----Original Message-----
> From: cygwin-owner@cygwin.com 
> [mailto:cygwin-owner@cygwin.com] On Behalf Of Frank Fesevur
> Sent: Tuesday, June 13, 2006 5:35 AM
> To: cygwin@cygwin.com
> Subject: vim 7 gives error when editing /etc/hosts
> 
> Hi,
> 
> When I try to edit /etc/hosts with vim7, it gives this error:
>    E303: Unable to open swap file for "hosts", recovery impossible
> 
> The file can be edited, but this never happened with 6.4
> 
> Regards,
> Frank
> 

vim appears to be unable to follow some links.

The following steps lead to the above error for me, also.

$ touch "c:\foo.txt"
$ ln -s "c:\foo.txt" bar.txt
$ vim bar.txt  # vim reports the swap-file error

On my computer, and I suspect on yours, /etc/hosts is a
symbolic link to Windows 'hosts' file:

$  ls -ln /etc/hosts
lrwxrwxrwx 1 13558 545 37 Apr  4 18:11 /etc/hosts ->
C:\WINDOWS\system32\drivers\etc\hosts

Curiously, the link does not cause an error if it was created using
"cygwin" syntax:

$ ln -fs /c/foo.txt bar.txt  # assumes that you've set the cygdrive
prefix to "/"
$ vim bar.txt   # No swap-file error is reported.

Until the problem code and its solution can be identified, you
should be able to use this workaround.

---

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


