MCPcopy
hub / github.com/benbjohnson/litestream / removeTmpFiles

Function removeTmpFiles

litestream.go:169–182  ·  view source on GitHub ↗

removeTmpFiles recursively finds and removes .tmp files.

(root string)

Source from the content-addressed store, hash-verified

167
168// removeTmpFiles recursively finds and removes .tmp files.
169func removeTmpFiles(root string) error {
170 return filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
171 switch {
172 case err != nil:
173 return nil // skip errored files
174 case info.IsDir():
175 return nil // skip directories
176 case !strings.HasSuffix(path, ".tmp"):
177 return nil // skip non-temp files
178 default:
179 return os.Remove(path)
180 }
181 })
182}
183
184// LTXDir returns the path to an LTX directory.
185func LTXDir(root string) string {

Callers 2

OpenMethod · 0.85
monitorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected