<div dir="ltr">Hi Michael,<div><br></div><div>The sourceFile function reads the file in chunks and passes each chunk down the conduit, although the sizes of the chunks are not specified. If that's ok with you, you may be able to do something as simple as this:</div><div><br></div><div>    sourceFile inFile `fuse` accumulateMD5 `fuseUpstream` sinkFile outFile</div><div><br></div><div>where accumulateMD5 does the MD5 calculation.</div><div><br></div><div>If you need control over the sizes of the chunks, I'd add something else to the pipeline between sourceFile and accumulateMD5 that sorts that out, rather than using sourceFileRange which will open the file and seek to the right place each time you call it.</div><div><br></div><div>Hope that helps,</div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 3 September 2016 at 18:37, Michael Litchard <span dir="ltr"><<a href="mailto:michael@schmong.org" target="_blank">michael@schmong.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I'd like to use conduits to (1) read a binary file in chunks <br>                   (2) take an md5 of that chunk (3) write the chunk to a file <br>                   (4) write md5 to file. I'm looking at Data.Conduit.Binary. <br>                   Do I want sourceFileRange for (1)?<br></div>
<br>______________________________<wbr>_________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/haskell-<wbr>cafe</a><br>
Only members subscribed via the mailman list are allowed to post.<br></blockquote></div><br></div>