#1276: a sum-file program not working under Windows
---------------------------------+------------------------------------------
 Reporter:  [EMAIL PROTECTED]  |          Owner:           
     Type:  bug                  |         Status:  closed   
 Priority:  normal               |      Milestone:           
Component:  libraries/base       |        Version:  6.6      
 Severity:  normal               |     Resolution:  duplicate
 Keywords:                       |     Difficulty:  Unknown  
 Testcase:                       |   Architecture:  x86      
       Os:  Windows              |  
---------------------------------+------------------------------------------
Changes (by duncan):

  * resolution:  => duplicate
  * component:  Compiler => libraries/base
  * status:  new => closed

Comment:

 The confusion here is over what {{{getContents}}} does. It reads from the
 standard input 'stdin'. It has nothing to do with parsing command line
 arguments.

 So that's why the program appears to hang, because it is waiting for input
 on its stdin, which by default is the console/terminal.

 So to run the program you should say:

 {{{
 sumcol_O.exe < "sumcol-input.txt"
 }}}

 to direct he file "sumcol-input.txt" to the standard input of
 {{{sumcol_O.exe}}}.


 If you want to use the command line arguments you should use the
 {{{getArgs}}} function and {{{readFile}}} as you noted.

 On the other hand, the {{{ByteString}}} example is indeed broken because
 {{{hGetBufNonBlocking}}} is broken on Windows. I'm marking this bug as a
 duplicate of  [http://hackage.haskell.org/trac/ghc/ticket/806 the bug for
 that problem].

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1276>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to