delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/04/14/08:40:48

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
Date: Thu, 14 Apr 2005 14:40:21 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Bash Process Substitution
Message-ID: <20050414124021.GD5908@cygbert.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <Pine DOT LNX DOT 4 DOT 44 DOT 0504140718170 DOT 12305-100000 AT ares DOT its DOT yale DOT edu>
Mime-Version: 1.0
In-Reply-To: <Pine.LNX.4.44.0504140718170.12305-100000@ares.its.yale.edu>
User-Agent: Mutt/1.4.2i

On Apr 14 08:04, Lev S Bishop wrote:
> I tried building bash from the source package, and then it uses either
> /dev/fd (if I have that as a symlink) or /proc/self/fd (if I don't),
> rather than the fifo that the binary package uses. So perhaps whoever
> built the binary package didn't have /proc/self/fd for whatever reason?

The bash package has been built before /proc/<pid>/fd came into existance.

> With my built bash.exe, process substitution seems to work for input:
> $ echo <(ls)
> /proc/self/fd/63
> $ cat <(echo hi)
> hi
> 
> But not for output:
> $ tar -cf >(cat) syntax.c
> tar: /proc/self/fd/63: Cannot open: Permission denied
> tar: Error is not recoverable: exiting now
> 
> I'm not sure how there can be a permissions problem or what to do about 
> it if there really is one, given that as I understand it 
> the /proc/self/fd/63 is effectively a symlink to one end of something 
> returned from pipe(2).

It's probably the wrong end.  In the Linux kernel there's some magic
going on which we can't reproduce in Cygwin so far.  Trying to open
an existing pipe for writing or reading opens apparently exactly the
right end of the pipe under Linux.  On Windows, you only get the exact
end of the pipe which is already available to the current process.  That's
the read side of the pipe, AFAICS, and that doesn't allow writing.  This
explains the "Permission denied".


HTH,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          mailto:cygwin AT cygwin DOT com
Red Hat, Inc.

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

- Raw text -


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