<div dir="auto"><br><div class="gmail_extra" dir="auto"><br><div class="gmail_quote">Den 27 juni 2017 9:47 em skrev "Silent Leaf" <<a href="mailto:silent.leaf0@gmail.com">silent.leaf0@gmail.com</a>>:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>i created a small clone of dd in haskell. I made it so it only copies block by block and only if there's any difference between each pair of blocks from each file. the idea is to use this dd clone as backup system, especially since my partitions are nearly full, so no real loss in copying the whole things.</div><div><br></div><div>I'm wondering if there's any way to check if my program never ever writes onto the target unless actually needed. obviously by reading the code i'd say it does what i want, but we do make test cases rather than rely on what we think the code does.</div><div><br></div><div>i can't run it with a target file that would be made read-only in the filesys (and hope for an error for trying to write on it) since obviously i need to open it in read-write right from the beginning, in case of actual need of writing (as apparently i can't have two handles on the same file... although maybe there's a way to change the mode of opening on the run? did not find it in System.IO nor in Hoogle or Hayoo)</div><div><br></div><div>so if anyone has an idea, in or outside of haskell, that would be great!</div></div>______________________________</blockquote></div></div><div dir="auto">Maybe you can use strace? <a href="https://youtu.be/4pEHfGKB-OE">https://youtu.be/4pEHfGKB-OE</a></div><div dir="auto"> </div><div class="gmail_extra" dir="auto"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/beginners</a><br></blockquote></div></div></div>