#2678: hLookAhead + hSetBuffering = unsupported operation (Illegal seek)
---------------------------------+------------------------------------------
Reporter: igloo | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: libraries/base | Version: 6.8.3
Severity: normal | Keywords:
Difficulty: Unknown | Testcase:
Architecture: Unknown/Multiple | Os: Unknown/Multiple
---------------------------------+------------------------------------------
If you compile and run this program, and then press 'a' while it is
running:
{{{
module Main (main) where
import System.IO
main :: IO ()
main = do hSetBuffering stdin NoBuffering
hLookAhead stdin >>= print
hSetBuffering stdin LineBuffering
}}}
then you get (amd64/Linux):
{{{
$ ./y
a'a'
y: <stdin>: hSetBuffering: unsupported operation (Illegal seek)
}}}
The docs at
http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-
IO.html#v%3AhSetBuffering
say what happens when setting a buffer to !NoBuffering, but don't give any
clue that this can happen when changing to !LineBuffering. I don't know if
it is the behaviour or the docs that should be changed.
Also happens in the 6.10 branch.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2678>
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