Let's say I want to save a stream of MyItem into a file (in JSON for example). I would like to stop when the file reach a certain size limit in bytes.
I would like to do it in Haskell... streaming is not the issue for me it's more how to get the file size information after each item put into this file...
Writing into a file in a streaming way and stop when we reach a given memory file size
115 views Asked by Nicolas Henin At
1
I don't think
pipesanything for this out of the box, but it's easy to write your owntoHandleBounded.On each step you check the file size and if it's less than the limit you loop, writing another block to the file.