devo analizzare un file, e in effetti un dovere leggerlo prima, qui è il mio programma:Come analizzare un file da 7 GB, con Data.ByteString?
import qualified Data.ByteString.Char8 as B
import System.Environment
main = do
args <- getArgs
let path = args !! 0
content <- B.readFile path
let lines = B.lines content
foobar lines
foobar :: [B.ByteString] -> IO()
foobar _ = return()
ma, dopo la compilazione
> ghc --make -O2 tmp.hs
l'esecuzione passa attraverso il seguente errore quando chiamato con un file 7Gigabyte.
> ./tmp big_big_file.dat
> tmp: {handle: big_big_file.dat}: hGet: illegal ByteString size (-1501792951): illegal operation
grazie per qualsiasi risposta!
Quale piattaforma sei? –
@DanielFischer come si chiama 'piattaforma'? se è il sistema operativo, allora sto usando Linux ubuntu 10.4. Grazie –
32 bit o 64? In generale un sistema operativo a 32 bit avrà problemi con file così grandi. –