[Haskell-cafe] (no subject)

Marc Weber marco-oweber at gmx.de
Thu May 24 04:39:32 EDT 2007


On Thu, May 24, 2007 at 02:38:05PM +0800, L.Guo wrote:
> Thanks for your suggestion, and sorry for the subject.
> 
> I have read the introduction of Data.ByteString, it is helpful.
> 
> And also, there is one problem left. When i read a binary file, data is truncated at the charactor EOF.

You have to use readBinaryFile instead of readFile.
I had the same trouble as well.

I finally implemented accessing single characters in C and did use ffi
because I didn't know haw to do this i haskell properly. ( using
peek/poke functions 4 bytes got written (wihch is annotateted somewhere
) If you are interested I can sent you the modified ByteString package.

If someone can tell me which haskell function to use to set a random
char in a memory buffer I would be pleased ..

Marc


More information about the Haskell-Cafe mailing list