Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Possible ZSH bug with IO direction
- X-seq: zsh-workers 38327
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Possible ZSH bug with IO direction
- Date: Sun, 24 Apr 2016 11:35:58 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=o5KSM5iHo3JtnU8rzt7IaiaVsAHlZ0gdcl5AWL6XUF4=; b=eE/zVqFc90LOAUcDVrD5LCFOBKR+uSK0e1M8sBakHC+cypuAybo+FfB/cYK4W3UCZK cvU21oZAEzBVFk/8+7frRmTadcAdqjULJBUYp2X3Te1nqcYA12RaROlHIXqKPdD0y+X8 9zAKvB2XsyCSBe+XM2ckjc4o8VlvvapQn1Qlilb9yYBasPXdrziOUm2AZQoX//FNJm1V 2QBN/EGAdN8VOFbcHxaZ8ri2l5b1bCeAqNd+KTjXxsdUy9ziPZ1kFiYS6KiHqwyK/fp0 s2mnKmiP0UAZZ4mZL6jztMHqchvlZVDJe0cbN5yGZ15GdVORTLddyU44iSccyTMFIwJf 23Rg==
- In-reply-to: <571CFD70.7090506@matrix.ai>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <571BBF3C.50402@matrix.ai> <160423151436.ZM6912@torch.brasslantern.com> <571CFD70.7090506@matrix.ai>
On Apr 25, 3:08am, Roger Qiu wrote:
} Subject: Re: Possible ZSH bug with IO direction
}
} Thanks, the workaround did work. But I've never seen read & write
} redirection at the interactive prompt. Does that make the STDIN for the
} program I'm running readable and writable?
Yes.
} How does that work?
Stdin/out/err are just file descriptors 0/1/2. They can be open in
whatever mode the parent process likes. It wouldn't make much sense
to have stdin open for write only, but nothing prevents that.
Consider that /dev/tty is all of stdin/out/err for most interactive
programs. It's open read/write even though programs don't usually treat
the individual descriptors that way.
} Can the program then rewind that descriptor, and write to `input.jpg`?
If the program were using system-call interfaces on descriptor 0, yes.
However the STDIO library object STDIN will still be initialized for
reading only, so in most cases the program won't notice.
} Also since Bash doesn't suffer from this problem, will this be fixed
} eventually?
As the comment from main.c explains, it's a question of either breaking
a few external programs that care about raw file data, or breaking the
entire internal string-processing in e.g. zsh's parameter substitution
any time those strings are read from a file. So I would expect the
answer is that this won't change unless Cygwin changes something. Also,
we're woefully short on any volunteers for Windows-specific issues.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author