Data.Binary에서 encodeFile 및 decodeFile 함수를 사용하여 매우 큰 데이터 구조를 저장하여 다시 계산할 필요가 없습니다. 이 프로그램을 실행할 때마다.Data.Binary.decodeFile을 사용하여 "demandInput : bytes not enough bytes"오류가 발생했습니다.
writePlan :: IO()
writePlan = do (d, _, bs) <- return subjectDomain
outHandle <- openFile "outputfile" WriteMode
((ebsP, aP), cacheData) <- preplanDomain d bs
putStrLn "Calculated."
let toWrite = ((map pseudofyOverEBS ebsP, aP),
pseudofyOverMap cacheData) :: WrittenData
in do encodeFile preplanFilename $ encode toWrite
putStrLn "Done."
readPlan :: IO (([EvaluatedBeliefState], [Action]), MVar HeuCache)
readPlan = do (d, _, _) <- return subjectDomain
inHandle <- openFile "outputfile" ReadMode
((ebsP, aP), cacheData) <- decodeFile preplanFilename :: IO WrittenData
fancyCache <- newMVar (M.empty, depseudofyOverMap cacheData)
return $! ((map depseudofyOverEBS ebsP, aP), fancyCache)
(writePlan하여) 파일을 계산 및 기록하는 프로그램이 거대한 바이너리 파일을 출력하는 에러없이 실행 다음과 같이 관련 encoding- 및 복호 함수이다. 내가 오류에 readPlan 결과를 실행,이 파일에 걸리는 프로그램을 실행할 때, (프로그램 이름은 "실시간"입니다) :
Realtime: demandInput: not enough bytes
내가 머리도이의 꼬리, 구글을 수색 할 수 없습니다 이 메시지에 대한 실질적인 문서 나 토론이 나오지 않았습니다. 모든 통찰력은 인정 될 것입니다!
어둠 속에서 찌르다가 얼마나 거대한가? 4 기가 바이트보다 큽니까? 어쩌면 32 비트 일 것입니까? –