diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-12-07 15:06:07 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-12-07 15:06:07 -0400 |
commit | 7a3e845add8c654dbb87fe427afd8655e6681792 (patch) | |
tree | b6ed80ef776d9b6e7a7350a36911c6d01cee884b /P2P | |
parent | dc08aeb67718d8fbe339ab51f0d7a1bf85fd597e (diff) |
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.
Diffstat (limited to 'P2P')
-rw-r--r-- | P2P/Annex.hs | 2 |
1 files changed, 1 insertions, 1 deletions
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 |