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

Method deleteFile

lib/model/folder_sendrecv.go:858–865  ·  view source on GitHub ↗

deleteFile attempts to delete the given file

(file protocol.FileInfo, dbUpdateChan chan<- dbUpdateJob, scanChan chan<- string)

Source from the content-addressed store, hash-verified

856
857// deleteFile attempts to delete the given file
858func (f *sendReceiveFolder) deleteFile(file protocol.FileInfo, dbUpdateChan chan<- dbUpdateJob, scanChan chan<- string) {
859 cur, hasCur, err := f.model.sdb.GetDeviceFile(f.folderID, protocol.LocalDeviceID, file.Name)
860 if err != nil {
861 f.newPullError(file.Name, fmt.Errorf("delete file: %w", err))
862 return
863 }
864 f.deleteFileWithCurrent(file, cur, hasCur, dbUpdateChan, scanChan)
865}
866
867func (f *sendReceiveFolder) deleteFileWithCurrent(file, cur protocol.FileInfo, hasCur bool, dbUpdateChan chan<- dbUpdateJob, scanChan chan<- string) {
868 // Used in the defer closure below, updated by the function body. Take

Callers 2

processNeededMethod · 0.95
processDeletionsMethod · 0.95

Calls 3

newPullErrorMethod · 0.95
deleteFileWithCurrentMethod · 0.95
GetDeviceFileMethod · 0.65

Tested by

no test coverage detected