[Haskell-cafe] reading from a unix pipe and then from the user
Brandon Allbery
allbery.b at gmail.com
Sun Oct 27 17:11:32 UTC 2019
It depends on what you're doing, to. For passwords, /dev/tty is almost
always best. If you have reason to expect that someone might want to
redirect the user's input for some reason, stderr would be a better choice.
But also consider that someone might want to capture a fatal error from
stderr (not all programs are well behaved, and in particular ghc's runtime
panics would still go to stderr ignoring brick; also consider any FFI
callouts to C that might assume stderr is a dedicated error channel) which
would again suggest /dev/tty. There's no one right answer here, in short.
On Sun, Oct 27, 2019 at 9:31 AM Neil Mayhew <
neil_mayhew at users.sourceforge.net> wrote:
> On 2019-10-26 2:27 a.m., Aramís Concepción Durán wrote:
>
> I could open a handle to `/dev/tty`
>
> It's also worth noting that many similar programs use stderr instead of
> /dev/tty. Each approach has its advocates. vim -i uses stderr, for example,
> and sudo uses /dev/tty.
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
--
brandon s allbery kf8nh
allbery.b at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20191027/6f9cc299/attachment.html>
More information about the Haskell-Cafe
mailing list