[Haskell-cafe] Binary file r/w example

Bo Herlin bo at gcab.net
Wed Apr 13 04:46:06 EDT 2005

Yes, I am, and the IOExtension module IS one of my problems.
The other problem is that I am interested in this Ptr thing, and I 
havent seen any examples in using it, and is seems like Ptr is not in 
any of my Haskell-books or in any of the tutorials that I have found.

Henning Thielemann wrote:
> On Wed, 13 Apr 2005, Bo Herlin wrote:
>> Hi, does anyone have a small but complete example on how to read a 
>> (portion of) a binary file, like r/w the header of a Midi-file?
>> It seems like readBinaryFile (ans writeBinaryFile) is deprecated and I 
>> should use hGetBuf (and hPutBuf), but what is this Ptr thing?
>> How would I implement readBinaryFile using hGetBuf?
> Are you aware of Haskore (www.haskell.org/haskore and 
> cvs.haskell.org/darcs/haskore) which provides a MidiFile reader and 
> writer? It has no good solution for reading and writing binary files, 
> but uses a platform dependent IOExtension module. :-(

More information about the Haskell-Cafe mailing list