
11 Feb
2002
11 Feb
'02
4:53 a.m.
In local.glasgow-haskell-users, you wrote:
suppose i want to write a stupid ftp client, i want to connect to the ftp server, wait for it to give it's intro stuff (welcome to blah, username: ) and then it wants input. how do i do something like this?
connect cfg = withSocketsDo $ do h <- connectTo (remoteAddr cfg) (Service (remoteType cfg)) hWaitForInput h 1000 s <- readWhileAvailable h return s
Why don't you use hGetLine? FTP is line based, so you just have to loop until there's no dash in the response. -- Wonderful \hbox (0.80312pt too nice) in paragraph at lines 16--18 Volker Stolz * stolz@i2.informatik.rwth-aachen.de Please use PGP or S/MIME for correspondence!