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

Function numberedFile

cmd/syncthing/monitor.go:397–401  ·  view source on GitHub ↗

numberedFile adds the number between the file name and the extension.

(name string, num int)

Source from the content-addressed store, hash-verified

395
396// numberedFile adds the number between the file name and the extension.
397func numberedFile(name string, num int) string {
398 ext := filepath.Ext(name) // contains the dot
399 withoutExt := name[:len(name)-len(ext)]
400 return fmt.Sprintf("%s.%d%s", withoutExt, num, ext)
401}
402
403// An autoclosedFile is an io.WriteCloser that opens itself for appending on
404// Write() and closes itself after an interval of no writes (closeDelay) or

Callers 3

TestRotatedFileFunction · 0.85
TestNumberedFileFunction · 0.85
rotateMethod · 0.85

Calls

no outgoing calls

Tested by 2

TestRotatedFileFunction · 0.68
TestNumberedFileFunction · 0.68