Send Beginners mailing list submissions to beginners@haskell.org To subscribe or unsubscribe via the World Wide Web, visit http://www.haskell.org/mailman/listinfo/beginners or, via email, send a message with subject or body 'help' to beginners-requ...@haskell.org
You can reach the person managing the list at beginners-ow...@haskell.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Beginners digest..." Today's Topics: 1. Re: Named Pipes Et Cetera (Patrick LeBoutillier) ---------------------------------------------------------------------- Message: 1 Date: Tue, 23 Nov 2010 10:39:59 -0500 From: Patrick LeBoutillier <patrick.leboutill...@gmail.com> Subject: Re: [Haskell-beginners] Named Pipes Et Cetera To: matthew coolbeth <mac01...@engr.uconn.edu> Cc: beginners@haskell.org Message-ID: <aanlktikqhtrpcdf+dqwzc3_06xhtw_wnzywnofga2...@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Here's the uname -a output: $ uname -a Linux pc207 2.6.30.10-105.2.23.fc11.x86_64 #1 SMP Thu Feb 11 07:06:34 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux Patrick On Tue, Nov 23, 2010 at 10:36 AM, Patrick LeBoutillier <patrick.leboutill...@gmail.com> wrote: > On Tue, Nov 23, 2010 at 9:13 AM, matthew coolbeth > <mac01...@engr.uconn.edu> wrote: >> That's interesting. This was using my source code? > > Yes, as is. I compiled it with "ghc --make pipe.hs". > > I'm running Fedora 10 x64 with: > $ ghc --version > The Glorious Glasgow Haskell Compilation System, version 6.10.1 > > Patrick > >> On mine (also a Linux box), it exited immediately, giving me no >> opportunity to write to the pipe. >> >> On 2010-11-23, Patrick LeBoutillier <patrick.leboutill...@gmail.com> wrote: >>> Matthew, >>> >>> Does it return immediately when you start it or only when you try to >>> write to the pipe with some client? >>> >>> Here's what I get on my Linux box: >>> >>> $ rm /tmp/dld.fifo && ./pipe & >>> [1] 8603 >>> $ echo -e "1\n2\n3" > /tmp/dld.fifo >>> 1 >>> 2 >>> 3 >>> pipe: /tmp/dld.fifo: hGetLine: end of file >>> >>> >>> Patrick >>> >>> >>> On Tue, Nov 23, 2010 at 7:55 AM, matthew coolbeth >>> <mac01...@engr.uconn.edu> wrote: >>>> Hello, all. >>>> >>>> Three questions: >>>> >>>> 1> What, if anything, can I do in a Haskell program to do blocking >>>> reads from a Linux FIFO? For the curious, there is a small program >>>> below that doesn't block, but immediately terminates because of an EOF >>>> >>>> 2> How could I have found the answer to this question on my own? (The >>>> documentation that Google found for me was not completely adequate) >>>> >>>> 3> Is this sort of question generally regarded as too unixy or not >>>> haskelly enough to be appropriate for this mailing list? >>>> >>>> Thanks. >>>> >>>> --BEGIN PROGRAM-- >>>> module Main () where >>>> >>>> import Control.Monad >>>> import System.IO >>>> import System.Posix.Files >>>> >>>> pipeString = "/tmp/dld.fifo" >>>> >>>> main :: IO () >>>> main = do >>>> createNamedPipe pipeString $ unionFileModes ownerReadMode >>>> ownerWriteMode >>>> pipe <- openFile pipeString ReadMode >>>> forever (hGetLine pipe >>= putStrLn) >>>> >>>> >>>> -- >>>> mac >>>> _______________________________________________ >>>> Beginners mailing list >>>> Beginners@haskell.org >>>> http://www.haskell.org/mailman/listinfo/beginners >>>> >>> >>> >>> >>> -- >>> ===================== >>> Patrick LeBoutillier >>> Rosemère, Québec, Canada >>> >> >> >> -- >> mac >> > > > > -- > ===================== > Patrick LeBoutillier > Rosemère, Québec, Canada > -- ===================== Patrick LeBoutillier Rosemère, Québec, Canada ------------------------------ _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners End of Beginners Digest, Vol 29, Issue 33 *****************************************