Skip to content
Permalink
Browse files

Add a Sync call before close when uploading a file to local storage

  • Loading branch information...
gilbertchen committed Jan 3, 2019
1 parent a354d03 commit bb652d0a8c7e89e9f0d4cb8acef7fdc453e21a6b
Showing with 10 additions and 1 deletion.
  1. +10 −1 src/duplicacy_filestorage.go
@@ -190,7 +190,16 @@ func (storage *FileStorage) UploadFile(threadIndex int, filePath string, content
return err
}

file.Close()
err = file.Sync()
if err != nil {
file.Close()
return err
}

err = file.Close()
if err != nil {
return err
}

err = os.Rename(temporaryFile, fullPath)
if err != nil {

2 comments on commit bb652d0

@cvillabrille

This comment has been minimized.

Copy link

replied Feb 28, 2019

@gilbertchen

This comment has been minimized.

Copy link
Owner Author

replied Sep 9, 2019

This commit has been mentioned on Duplicacy Forum. There might be relevant details there:

https://forum.duplicacy.com/t/failed-to-parse-the-snapshot-invalid-character-x00-looking-for-beginning-of-value/1731/6

Please sign in to comment.
You can’t perform that action at this time.