MCPcopy
hub / github.com/etcd-io/bbolt / CopyTempFile

Method CopyTempFile

internal/btesting/btesting.go:195–202  ·  view source on GitHub ↗

CopyTempFile copies a database to a temporary file.

()

Source from the content-addressed store, hash-verified

193
194// CopyTempFile copies a database to a temporary file.
195func (db *DB) CopyTempFile() {
196 path := filepath.Join(db.t.TempDir(), "db.copy")
197 err := db.View(func(tx *bolt.Tx) error {
198 return tx.CopyFile(path, 0600)
199 })
200 require.NoError(db.t, err)
201 fmt.Println("db copied to: ", path)
202}
203
204// PrintStats prints the database stats
205func (db *DB) PrintStats() {

Callers 2

TestBucket_Put_SingleFunction · 0.80
TestBucket_Put_MultipleFunction · 0.80

Calls 2

ViewMethod · 0.95
CopyFileMethod · 0.80

Tested by 2

TestBucket_Put_SingleFunction · 0.64
TestBucket_Put_MultipleFunction · 0.64