On Fri, 9 Nov 2007, Derek Elkins wrote:
> Pointless frobbing but is there any issue with setting the echo to False
> when it is already False? Otherwise not checking seems to both simpler
> and quicker (not that performance matters), i.e.
> getpasswd h = do
> wasEnabled <- hGetEcho h
> h
On Fri, 2007-11-09 at 17:41 +0100, Alfonso Acosta wrote:
> I this there's no need for a binding
>
> How about this?
>
> import Control.Monad (when)
> import System.IO
>
> getpasswd :: Handle -> IO String
> getpasswd h = do wasEnabled <- hGetEcho h
> when wasEnab
I this there's no need for a binding
How about this?
import Control.Monad (when)
import System.IO
getpasswd :: Handle -> IO String
getpasswd h = do wasEnabled <- hGetEcho h
when wasEnabled (hSetEcho h False)
str <- hGetLine h
On Fri, 9 Nov 2007 16:09:57 +
"Neil Mitchell" <[EMAIL PROTECTED]> wrote:
> Hi
>
> > I've written a little Haskell program to get information from a
> > MySQL database (great thanks to anybody reading this who works on
> > HSQL, by the way) but I want to keep the user's password concealed,
> >
On Nov 9, 2007 5:09 PM, Neil Mitchell <[EMAIL PROTECTED]> wrote:
> A quick Hoogle search for echo suggests hSetEcho, so perhaps hSetEcho
> stdin False would work.
Ops, Neil sent while I was still writing, I didn't know the existance
of this function.
___
On Fri, 2007-11-09 at 10:59 -0500, Taylor Venable wrote:
> Hello all,
>
> I've written a little Haskell program to get information from a MySQL
> database (great thanks to anybody reading this who works on HSQL, by
> the way) but I want to keep the user's password concealed, obviously.
> Currently
I never used System.POSIX.Terminal myself but from what I read in the
haddock documentation I think this function can help you.
import System.Posix.Types (Fd)
import System.Posix.Terminal
disableEcho :: Fd -> IO ()
disableEcho fd = do
attribs <- getTerminalAttributes fd
setTerminalAttribu
Hi
> I've written a little Haskell program to get information from a MySQL
> database (great thanks to anybody reading this who works on HSQL, by
> the way) but I want to keep the user's password concealed, obviously.
> Currently I prompt for it from the terminal, but the problem is that
> it's ec
Hello all,
I've written a little Haskell program to get information from a MySQL
database (great thanks to anybody reading this who works on HSQL, by
the way) but I want to keep the user's password concealed, obviously.
Currently I prompt for it from the terminal, but the problem is that
it's echo