From 0362320deb373dd1824e0f170889ad0f50be41bf Mon Sep 17 00:00:00 2001 From: Marin Atanasov Nikolov Date: Mon, 1 Jul 2019 19:46:51 +0300 Subject: [PATCH] db.Path() resolves to db.file.Name() (#168) --- db.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db.go b/db.go index 870c8b1..80b0095 100644 --- a/db.go +++ b/db.go @@ -206,12 +206,12 @@ func Open(path string, mode os.FileMode, options *Options) (*DB, error) { } // Open data file and separate sync handler for metadata writes. - db.path = path var err error - if db.file, err = db.openFile(db.path, flag|os.O_CREATE, mode); err != nil { + if db.file, err = db.openFile(path, flag|os.O_CREATE, mode); err != nil { _ = db.close() return nil, err } + db.path = db.file.Name() // Lock file so that other processes using Bolt in read-write mode cannot // use the database at the same time. This would cause corruption since