Posix library ,Concurrent Haskell and Haskell IO sub-system

Rafael Martinez Torres rmartine@fdi.ucm.es
Fri, 11 Jul 2003 07:37:06 +0200 (CEST)


On Thu, 10 Jul 2003, Volker Stolz wrote:

> In local.glasgow-haskell-users, you wrote:
> > I use the Posix library since I have to communicate via a pipe with
> > another UNIX process.
> >
> > Therefore I have to use
> > fdRead :: Fd -> ByteCount -> IO (String,ByteCount)
>
> Why do you "have to" use an Fd?
>A regular handle should be sufficient.
> Where do you get the Fd from?

createPipe :: IO (Fd,Fd) (Unkown alternatives)

> Did you consider lifting the Fd back
> to a Handle?

How ? Only known

intToFd :: Int -> Fd
fdToInt :: Fd -> Int

>If you really need to read exactly ByteCount bytes, you could
> go the hard way and set the handle to unbuffered IO and call hGetChar
> n times.

OK.

What about ?

threadReadWait :: Int -> IO()

Should I convert a Handle into a Int ?