MCPcopy
hub / github.com/rclone/rclone / ListR

Function ListR

fs/walk/walk.go:149–164  ·  view source on GitHub ↗

ListR lists the directory recursively. If includeAll is not set it will use the filters defined. If maxLevel is < 0 then it will recurse indefinitely, else it will only do maxLevel levels. If synthesizeDirs is set then for bucket-based remotes it will synthesize directories from the file structur

(ctx context.Context, f fs.Fs, path string, includeAll bool, maxLevel int, listType ListType, fn fs.ListRCallback)

Source from the content-addressed store, hash-verified

147//
148// NB (f, path) to be replaced by fs.Dir at some point
149func ListR(ctx context.Context, f fs.Fs, path string, includeAll bool, maxLevel int, listType ListType, fn fs.ListRCallback) error {
150 fi := filter.GetConfig(ctx)
151 // FIXME disable this with --no-fast-list ??? `--disable ListR` will do it...
152 doListR := f.Features().ListR
153
154 // Can't use ListR if...
155 if doListR == nil || // ...no ListR
156 fi.HaveFilesFrom() || // ...using --files-from
157 maxLevel >= 0 || // ...using bounded recursion
158 len(fi.Opt.ExcludeFile) > 0 || // ...using --exclude-file
159 fi.UsesDirectoryFilters() { // ...using any directory filters
160 return listRwalk(ctx, f, path, includeAll, maxLevel, listType, fn)
161 }
162 ctx = filter.SetUseFilter(ctx, f.Features().FilterAware && !includeAll) // make filter-aware backends constrain List
163 return listR(ctx, f, path, includeAll, listType, fn, doListR, listType.Dirs() && f.Features().BucketBased)
164}
165
166// listRwalk walks the file tree for ListR using Walk
167// Note: this will flag filter-aware backends (via Walk)

Callers 15

RmdirMethod · 0.92
DirMoveMethod · 0.92
ReconcileTempUploadsMethod · 0.92
ListRMethod · 0.92
ListRMethod · 0.92
StatfsMethod · 0.92
compareNamesFunction · 0.92
listObjectsMethod · 0.92
histogram.goFile · 0.92
runBisyncMethod · 0.92
ArchiveCreateFunction · 0.92
newRunIndividualFunction · 0.92

Calls 8

GetConfigFunction · 0.92
SetUseFilterFunction · 0.92
listRwalkFunction · 0.85
listRFunction · 0.85
HaveFilesFromMethod · 0.80
UsesDirectoryFiltersMethod · 0.80
FeaturesMethod · 0.65
DirsMethod · 0.45

Tested by 5

compareNamesFunction · 0.74
runBisyncMethod · 0.74
TestMarchFunction · 0.74
compareNamesFunction · 0.74
TestDeduplicateRenameFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…