[Haskell-cafe] ByteString.getContents fails for files 2GB on OS X

2012-06-07 Thread Shaun Jackman
Hi, Data.ByteString.Char8.getContents fails for files 2GB on OS X. Is there a fix for this? $ cat getContents.hs main = getContents $ ./getContents smallFile $ ./getContents bigFile getContents: stdin: hGetBuf: invalid argument (Invalid argument) $ ghc --version The Glorious Glasgow Haskell

Re: [Haskell-cafe] ByteString.getContents fails for files 2GB on OS X

2012-06-08 Thread Shaun Jackman
build? That might have something to do with it, if you're nearing 2^32 (or 2^31) bytes. Erik On Fri, Jun 8, 2012 at 2:25 AM, Shaun Jackman sjack...@gmail.com wrote: Hi, Data.ByteString.Char8.getContents fails for files 2GB on OS X. Is there a fix for this? $ cat getContents.hs main

Re: [Haskell-cafe] ByteString.getContents fails for files 2GB on OS X

2012-06-21 Thread Shaun Jackman
System.IO.MMap (mmapFileByteString) worked like a charm in loading files larger than 2 GB on OS X. Using mmapFileByteString and strict ByteString is roughly seven times faster for my program than using getContents and ByteString.Lazy. Cheers, Shaun On 11 June 2012 07:08, Gracjan Polak