]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Make bolt completion DB directory if necessary
authorMatt Joiner <anacrolix@gmail.com>
Thu, 1 Jun 2017 01:20:50 +0000 (11:20 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Thu, 1 Jun 2017 01:20:50 +0000 (11:20 +1000)
storage/boltPieceCompletion.go

index 510e283459063e6914b310d18a7d7b882cf91630..52e38f6a69564052f1cf65e8b0fd0f9636498424 100644 (file)
@@ -2,6 +2,7 @@ package storage
 
 import (
        "encoding/binary"
+       "os"
        "path/filepath"
        "time"
 
@@ -19,6 +20,7 @@ type boltPieceCompletion struct {
 }
 
 func NewBoltPieceCompletion(dir string) (ret PieceCompletion, err error) {
+       os.MkdirAll(dir, 0770)
        p := filepath.Join(dir, ".torrent.bolt.db")
        db, err := bolt.Open(p, 0660, &bolt.Options{
                Timeout: time.Second,