[GHC] #1276: a sum-file program not working under Windows
GHC
trac at galois.com
Sat Apr 14 06:54:41 EDT 2007
#1276: a sum-file program not working under Windows
---------------------------------+------------------------------------------
Reporter: nanotitan at gmail.com | 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
-------------- next part --------------
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs at haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
More information about the Glasgow-haskell-bugs
mailing list