MCPcopy Index your code
hub / github.com/syncthing/syncthing / copyFile

Function copyFile

lib/syncthing/utils.go:132–145  ·  view source on GitHub ↗
(src, dst string)

Source from the content-addressed store, hash-verified

130}
131
132func copyFile(src, dst string) error {
133 bs, err := os.ReadFile(src)
134 if err != nil {
135 return err
136 }
137
138 if err := os.WriteFile(dst, bs, 0o600); err != nil {
139 // Attempt to clean up
140 os.Remove(dst)
141 return err
142 }
143
144 return nil
145}
146
147// Opens a database
148func OpenDatabase(path string, deleteRetention time.Duration) (db.DB, error) {

Callers 1

archiveAndSaveConfigFunction · 0.70

Calls 1

RemoveMethod · 0.65

Tested by

no test coverage detected