delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/09/04/16:34:25

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:from:date:message-id:subject:to
:content-type; q=dns; s=default; b=i5LR/jCXhsBuaJ01DWNEbF41xjpN7
sO9AiXLQAbwTkw/dwQgbRqNcus9k1ozNY4w8ZOrQ5Q0IR76Fw+RdsWS5Qc607OOC
70s2NuseXzNxtN7DiRcEK8EkssRijKr6XxIDUeKsrsvNtL2l3/yfOqx5EAPDKyPv
X75Lllosvi+ods=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:from:date:message-id:subject:to
:content-type; s=default; bh=4Cnw7qxo+adT3JD9YMrkFT72rds=; b=dx9
EPNa7uEe0uiCa6xbrhiypHt1UW86DA00neyxhbYQo/Eu1NzkgDSbAYh7naxYPkFm
FpuT45BfwP5OsSJsgwEjyKXkhT5FHH/hJH6R/wuwn4HwNhZ+stm6kpzDP7s0W9HR
EpBlUU5ZCkTmUIzFt3i4Z5t20XIsLTMy9ZksHRbA=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-0.3 required=5.0 tests=AWL,BAYES_20 autolearn=ham version=3.3.2
X-HELO: s87.webhostingserver.nl
X-Received: by 10.152.23.131 with SMTP id m3mr7256496laf.8.1409862838572; Thu, 04 Sep 2014 13:33:58 -0700 (PDT)
MIME-Version: 1.0
From: Frank Fesevur <ffes AT users DOT sourceforge DOT net>
Date: Thu, 4 Sep 2014 22:33:28 +0200
Message-ID: <CAKf2h5SeYQ_Gg0u7ERH6ejZoXDwbPEB_ngpLzUO3qEexJYb0tA@mail.gmail.com>
Subject: vim can't write /etc/hosts
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
X-IsSubscribed: yes

Hi,

On my Win81 machine I tried to edit /etc/hosts with vim. When I try to
write the file I get this error:
"/etc/hosts" E166: Can't open linked file for writing

Since /etc/hosts is a symlink to
/cygdrive/c/windows/System32/drivers/etc/hosts so I tried to edit the
file with the full path but that fails as well:
"/cygdrive/c/windows/System32/drivers/etc/hosts" E212: Can't open file
for writing

I did all this with my mintty started as administrator:
uid=1000(Frank) gid=513(Geen)
groups=513(Geen),0(root),544(Administrators),545(Gebruikers)

I can edit the file starting my Notepad++ as administrator and open file.

A bit surprising but this works:

Frank AT PC7 /cygdrive/c/Windows/System32/drivers/etc
# echo "# test" >> hosts

Why can't vim write the file, or even better the symlinked file? I'm
quite sure editing the symlink works in Win7, but can try tomorrow.

Regards,
Frank

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019