
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? Thanks! NP _________________________________________________________________ Search from any Web page with powerful protection. Get the FREE Windows Live Toolbar Today! http://www.toolbar.live.com

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

Hello Donald, Thursday, November 2, 2006, 4:31:31 AM, you wrote:
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?
For flat lists of bytes, use Data.ByteString, for structured data, try NewBinary.
you can also use hGetBuf and pointers machinery -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com
participants (3)
-
Bulat Ziganshin
-
dons@cse.unsw.edu.au
-
Nuno Pinto