From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: Possible ZSH bug with IO direction
Date: Sun, 24 Apr 2016 11:35:58 -0700 [thread overview]
Message-ID: <160424113558.ZM3564@torch.brasslantern.com> (raw)
In-Reply-To: <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.
next prev parent reply other threads:[~2016-04-24 18:35 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-23 18:30 Roger Qiu
2016-04-23 22:14 ` Bart Schaefer
2016-04-24 12:17 ` Peter Stephenson
2016-04-24 18:36 ` Bart Schaefer
2016-04-24 19:01 ` Peter Stephenson
2016-04-24 21:23 ` m0viefreak
2016-04-25 9:12 ` Peter Stephenson
2016-04-25 17:25 ` Peter A. Castro
2016-04-24 21:53 ` Bart Schaefer
2016-04-25 8:46 ` Peter Stephenson
2016-04-25 21:12 ` Mikael Magnusson
2016-04-25 17:16 ` Peter A. Castro
2016-04-24 17:08 ` Roger Qiu
2016-04-24 18:35 ` Bart Schaefer [this message]
2016-04-25 17:31 ` Peter A. Castro
2016-04-25 17:47 ` Bart Schaefer
2016-04-25 18:14 ` Peter A. Castro
2016-04-26 9:16 ` Peter Stephenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=160424113558.ZM3564@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).