From 7a3e845add8c654dbb87fe427afd8655e6681792 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 7 Dec 2016 15:06:07 -0400 Subject: open file for append, not write, so resuming works WriteMode zeros any existing content, so the seek filled with zeros, and verification failed after download. --- P2P/Annex.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/P2P/Annex.hs b/P2P/Annex.hs index 4105abe32..daab74447 100644 --- a/P2P/Annex.hs +++ b/P2P/Annex.hs @@ -120,7 +120,7 @@ runLocal runmode runner a = case a of -- a client. Client -> ta storefile dest (Offset o) (Len l) b = liftIO $ do - withBinaryFile dest WriteMode $ \h -> do + withBinaryFile dest AppendMode $ \h -> do when (o /= 0) $ hSeek h AbsoluteSeek o L.hPut h b -- cgit v1.2.3