MCPcopy
hub / github.com/rclone/rclone / AddFile

Method AddFile

fs/filter/filter.go:371–387  ·  view source on GitHub ↗

AddFile adds a single file to the files from list

(file string)

Source from the content-addressed store, hash-verified

369
370// AddFile adds a single file to the files from list
371func (f *Filter) AddFile(file string) error {
372 f.initAddFile()
373 file = strings.Trim(file, "/")
374 f.files[file] = struct{}{}
375 // Put all the parent directories into f.dirs
376 for {
377 file = path.Dir(file)
378 if file == "." {
379 break
380 }
381 if _, found := f.dirs[file]; found {
382 break
383 }
384 f.dirs[file] = struct{}{}
385 }
386 return nil
387}
388
389// Files returns all the files from the `--files-from` list
390//

Callers 14

testCopyWithFilesFromFunction · 0.95
TestNewFilterMakeListRFunction · 0.95
TestLsWithFilesFromFunction · 0.95
newFsFileAddFilterFunction · 0.80
modifyListingMethod · 0.80
fastCopyMethod · 0.80
applyDeltasMethod · 0.80
copyFileMethod · 0.80
touchFilesFunction · 0.80

Calls 2

initAddFileMethod · 0.95
DirMethod · 0.80

Tested by 8

testCopyWithFilesFromFunction · 0.76
TestNewFilterMakeListRFunction · 0.76
TestLsWithFilesFromFunction · 0.76
copyFileMethod · 0.64
touchFilesFunction · 0.64