[Haskell-cafe] Basic Binary IO
Donald Bruce Stewart
dons at cse.unsw.edu.au
Wed Nov 1 20:31:31 EST 2006
nuno:
>
> Hi all!
>
> Today i was reading System.IO and didn't manage to
> understand how it works just by reading it.
> I looked the internet for some help on this, but only
> "advanced" information is available.
> Can anyone show me how to use openBinaryFile ?
> Just an example, like opening file "somefile" and separating
> it into something that can be edited in the code (like 8 bit
> words) then go to word nr12 and edit the last bit?
http://haskell.org/haskellwiki/Binary_IO
For flat lists of bytes, use Data.ByteString, for structured data, try
NewBinary.
There are other options too, documented above.
openBinaryFile just sets the line ending handling on windows. I don't
think it does what you think it does.
-- Don
More information about the Haskell-Cafe
mailing list