X-Recipient: archive-cygwin@delorie.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:content-type:to:subject:references:date
	:mime-version:content-transfer-encoding:from:message-id
	:in-reply-to; q=dns; s=default; b=UGkdHqFHDmDu3MHmZYvfFoo3uEIXbn
	/7L+iEaCi+RVUwEsJQV06bouQCLXw0LSC4r4pL2v9JB/ioYdOZi/xzUXyqKvXCZz
	3ucHHrKZQr6sUCtPkXtghrpUPLb1BcqNWS/8lrxtab/V0Rs9PMnRTtGGwBebeUUy
	HO5rzve6X24kA=
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:content-type:to:subject:references:date
	:mime-version:content-transfer-encoding:from:message-id
	:in-reply-to; s=default; bh=q/JaAjFbWYrKD0tWs9CWf+BSfzQ=; b=PD7H
	9DcIBxiOriRvnO4fwRsumsAsf9g4AIiPa5Q79MSFnm5EG90PIOd30M7e55tUVR1m
	qwhJS8TrIVjZFK2zXlDXUWqu1XGyw7K7gx7T16FGhoGJYGo8wH2m+FzUfSCEyDkQ
	lUOaWNRwO+jJPmNcMJKbFHS86WNiFor7aYCSsZU=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=03.07.2016, Hx-languages-length:1307, H*c:iso-8859-15, 03072016
X-HELO: mailout.ish.de
X-Abuse-ID: hremUFXL0y-8240@umkbw.customer
Anomaly-Results: submit.unitybox.de; rate=0%
Dubio-Filter: Adamant Filter v2016.04.1 submit.unitybox.de 3rj7h26Plhz6dtC2
Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes
To: cygwin@cygwin.com
Subject: Re: symlinks to unlinked but open files should work
References: <op.yjxvo5gyofd6j1@frascati.upc.de> <20160703111436.GA6301@calimero.vinschen.de>
Date: Sun, 03 Jul 2016 13:48:17 +0200
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: "Helmut Karlowski" <helmut.karlowski@ish.de>
Message-ID: <op.yj0werznofd6j1@frascati.upc.de>
In-Reply-To: <20160703111436.GA6301@calimero.vinschen.de>
User-Agent: Opera Mail/12.17 (Win32)
X-IsSubscribed: yes

Am 03.07.2016, 13:14 Uhr, schrieb Corinna Vinschen:

> You don't even need a symlink.  This will show the same result:
>
>   exec >out1
>   rm out1
>   [[ -w /dev/fd/1 ]] || echo /dev/fd/1 not writable 1>&2

I noticed that too meanwhile, but I thought you would not need that  
information ;)
It's only about the /dev/fd-symlinks, otherwise cygwin seems to be  
correct: they don't work anywhere on an open but deleted file:

ln -sf out1 lout1
exec >out1
[[ -w lout1 ]] || echo lout1 not writable-1 1>&2
rm out1
[[ -w lout1 ]] || echo lout1 not writable-2 1>&2
rm lout1

correctly prints the second message.

> In Cygwin we move a deleted but still open file out of the way (into
> the trash) so the path is incorrect afterwards but even if we wouldn't
> do that, the underlying problem can't be solved:
>
> The problem is that a deleted file in Windows can't be opened anymore.
> If you translate the above -w <file> into a libc call access
> ("/dev/fd/1", W_OK) or its Windows equivalent, that call will always
> fail on a deleted file.  Same for open/CreateFile, etc.
>
> Sorry, but off the top of my head I don't see a feasible workaround for
> this problem.

Not a big issue - I don't know any situation this would break except the  
above /dev/fd-test.

-Helmut


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

