]> Sergey Matveev's repositories - btrtrc.git/commitdiff
It's not an error if the write file does not exist after trying to rename from the...
authorMatt Joiner <anacrolix@gmail.com>
Thu, 29 May 2025 07:43:01 +0000 (17:43 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Thu, 29 May 2025 07:44:29 +0000 (17:44 +1000)
storage/file-piece.go

index 30746320de11016dd0e8aeddecb1c3229bca1f18..fe8cd6ba07562c223f369bd332fda5e663a3e66e 100644 (file)
@@ -248,6 +248,9 @@ func (me *filePieceImpl) onFileNotComplete(f file) (err error) {
                }
        }
        info, err := os.Stat(me.pathForWrite(f))
+       if errors.Is(err, fs.ErrNotExist) {
+               return nil
+       }
        if err != nil {
                err = fmt.Errorf("statting file: %w", err)
                return