From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23012 invoked from network); 26 Mar 2005 17:05:44 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 26 Mar 2005 17:05:44 -0000 Received: (qmail 20963 invoked from network); 26 Mar 2005 17:05:38 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 26 Mar 2005 17:05:38 -0000 Received: (qmail 24909 invoked by alias); 26 Mar 2005 17:05:35 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21064 Received: (qmail 24896 invoked from network); 26 Mar 2005 17:05:35 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 26 Mar 2005 17:05:35 -0000 Received: (qmail 20656 invoked from network); 26 Mar 2005 17:05:35 -0000 Received: from vms042pub.verizon.net (206.46.252.42) by a.mx.sunsite.dk with SMTP; 26 Mar 2005 17:05:30 -0000 Received: from candle.brasslantern.com ([4.11.1.68]) by vms042.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0IDY00BWWY549IQ3@vms042.mailsrvcs.net> for zsh-workers@sunsite.dk; Sat, 26 Mar 2005 11:05:29 -0600 (CST) Received: from candle.brasslantern.com (IDENT:schaefer@localhost [127.0.0.1]) by candle.brasslantern.com (8.12.11/8.12.11) with ESMTP id j2QH5Ln4019505 for ; Sat, 26 Mar 2005 09:05:27 -0800 Received: (from schaefer@localhost) by candle.brasslantern.com (8.12.11/8.12.11/Submit) id j2QH5GDO019504 for zsh-workers@sunsite.dk; Sat, 26 Mar 2005 09:05:16 -0800 Date: Sat, 26 Mar 2005 17:05:15 +0000 From: Bart Schaefer Subject: Re: Any comment on file descriptor behavior in functions? In-reply-to: <200503221831.j2MIVI09014962@news01.csr.com> To: zsh-workers@sunsite.dk Message-id: <1050326170515.ZM19503@candle.brasslantern.com> MIME-version: 1.0 X-Mailer: Z-Mail (5.0.0 30July97) Content-type: text/plain; charset=us-ascii References: <1050321002236.ZM10916@candle.brasslantern.com> <200503221404.j2ME41EL009572@news01.csr.com> <1050322171125.ZM13668@candle.brasslantern.com> <200503221831.j2MIVI09014962@news01.csr.com> Comments: In reply to Peter Stephenson "Re: Any comment on file descriptor behavior in functions?" (Mar 22, 6:31pm) X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 Finally got a chance to apply this patch and try it. Looks good. On Mar 22, 6:31pm, Peter Stephenson wrote: } } Bart Schaefer wrote: } > That's not it, or rather it's too much of it. That also leaves open the } > xtrace output descriptor, etc. The fix needs to be more specific. } } (I can't see any evidence for ", etc.", but I presume you just didn't } perform an exhaustive search.) Correct; I'm sorry. } As far as I can see, when entering a function the values for process } subsitutions would be incremented so that both types would be closed for } an external program, but on a nested function they'd both be incremented } further so they wouldn't. Yes, I concur. What I can't figure out is why they need to be incremented at all? Why not just assign them the do-not-close value to begin with? Something having to do with them persisting for only one command? Appended is a suggested test entry. While writing this, I noticed that the first process substitution test relies on the 'cut' and 'paste' external commands. I guess there's never been a problem with that, but I wasn't aware they were both supported on all platforms where zsh has been compiled. Index: Test/D03procsubst.ztst =================================================================== retrieving revision 1.3 diff -c -r1.3 D03procsubst.ztst --- Test/D03procsubst.ztst 23 Sep 2003 15:27:17 -0000 1.3 +++ Test/D03procsubst.ztst 26 Mar 2005 17:02:51 -0000 @@ -12,6 +12,8 @@ true fi + function copycat { cat "$@" } + %test paste <(cut -f1 FILE1) <(cut -f3 FILE2) 0:<(...) substitution @@ -29,3 +31,8 @@ >< First Second Third Fourth >--- >> Erste Zweite Dritte Vierte + + copycat <(print First) <(print Zweite) +0:FDs remain open for external commands called from functions +>First +>Zweite