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.
This commit is contained in:
Joey Hess 2016-12-07 15:06:07 -04:00
parent b55399e3ac
commit 99c36f318c
No known key found for this signature in database
GPG key ID: C910D9222512E3C7

View file

@ -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