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: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 AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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=-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 AT umkbw DOT 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 AT cygwin DOT com Subject: Re: symlinks to unlinked but open files should work References: <20160703111436 DOT GA6301 AT calimero DOT vinschen DOT de> Date: Sun, 03 Jul 2016 13:48:17 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Helmut Karlowski" Message-ID: 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 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