From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14716 invoked by alias); 13 Sep 2016 16:25:13 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21892 Received: (qmail 21062 invoked from network); 13 Sep 2016 16:25:13 -0000 X-Qmail-Scanner-Diagnostics: from mail-qk0-f172.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.220.172):SA:0(1.1/5.0):. Processed in 0.300586 secs); 13 Sep 2016 16:25:13 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=DATE_IN_PAST_06_12, FREEMAIL_FROM,SPF_PASS,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: sgniazdowski@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.220.172 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=XWnXoKtXsKS7K5TiN6WuaXr4j4Q1VAtrVglC+bC3NxY=; b=qMuQuU+h50/2TPHRAM+MA3Y26EUhPhPyuCBwZD+E5Fxwx039giYjKafxddpqF5KAZG /IXTgK9MwxL3P1gwZ24tU3ZN4AMJyNUOdLzsf06tTEhwtqABCatgsgv2/bXytl39ZKYD kt3hbLdR2mCgjbdFFaJbXNKdMDqBIKfuLq8Dd2I3dmcbsrHKSlLceYH8OnX+uPBOtAh2 Jz3PTRGlA5qDbXW0FDzLfkkvvRTfq/z0GWduLXyHDz2Cg3HkJKL0SOX5KQLCUG+DMIjZ UenoecievFQ6VL8qdjuweVoXnW53DVbg7lMYQj7Pk8L2NvmwgrYe8BhyEw8Tns+LG60s NumQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=XWnXoKtXsKS7K5TiN6WuaXr4j4Q1VAtrVglC+bC3NxY=; b=jVhyfTtp5biSapo2Vr7kRERi0HUPgjK5nKPpWCK1RAk37LYLYfQ5YrXXrkkIDhSae2 +AWf1alr4Y682Y5ojmnuUk6qBgbsp0wr4sz65yVqz7loIjg5JFH623xvpD0WeKRq6WVT dluOSvFk1VZco7n2KPshkmlzQQ4jE0L6uQu2KUUN/nJatvXeNo5l7Q41M/28II4UjUN5 ZmsNFc4ZZoMzJKVE6lNqhhgsgAjPGOwNU+liT6eYB02hRoRZwyYbS9RcZjh/YxbTtGzk 72GnmH+OqOJGQB4heIojBvWKmXa6UQuhwFRd/aaU5MNhRIt8p6+e8g5KJvNHwh+oDGYh /N7Q== X-Gm-Message-State: AE9vXwOiKKgpiZngN0URIk7ZWxTATVazcwNnYjqr8VaCGS9H2UevGyOHp0O82VP7ynr230BC6K35sNlqDbToxw== X-Received: by 10.55.147.199 with SMTP id v190mr18585437qkd.192.1473756872862; Tue, 13 Sep 2016 01:54:32 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <160912112451.ZM25357@torch.brasslantern.com> References: <20160912171959.2516a91e@pwslap01u.europe.root.pri> <160912112451.ZM25357@torch.brasslantern.com> From: Sebastian Gniazdowski Date: Tue, 13 Sep 2016 10:54:12 +0200 Message-ID: Subject: Re: Do file descriptors survive to subshell? To: Bart Schaefer Cc: Zsh Users Content-Type: text/plain; charset=UTF-8 On 12 September 2016 at 20:24, Bart Schaefer wrote: > ?? That's not how "read" is defined. It either reads a line if it can, > or it returns failure if it can't. The -t option only changes what > "it can't" means, and the -u option only changes where it reads it. > You can change how "a line" is defined, but you can't define "a line" > as nothing. > > You might suggest that -k 0 should test whether reading is possible and > return success without actually reading anything, but as currently > defined "read" returns nonzero only when bytes are consumed. That's quite regretful, how to check if a read descriptor is valid? To test if a descriptor is inherited from previous Zsh execution I switched to write descriptors and use print -u $EXPORTED_FD -n to test them, this works. Best regards, Sebastian Gniazdowski