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

Function sameFile

tx.go:470–481  ·  view source on GitHub ↗
(f1, f2 *os.File)

Source from the content-addressed store, hash-verified

468}
469
470func sameFile(f1, f2 *os.File) (bool, error) {
471 fi1, err := f1.Stat()
472 if err != nil {
473 return false, fmt.Errorf("failed to get fileInfo of the first file (%s): %w", f1.Name(), err)
474 }
475 fi2, err := f2.Stat()
476 if err != nil {
477 return false, fmt.Errorf("failed to get fileInfo of the second file (%s): %w", f2.Name(), err)
478 }
479
480 return os.SameFile(fi1, fi2), nil
481}
482
483// CopyFile copies the entire database to file at the given path.
484// A reader transaction is maintained during the copy so it is safe to continue

Callers 1

WriteToMethod · 0.85

Calls 1

ErrorfMethod · 0.65

Tested by

no test coverage detected