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)
| 147 | // |
| 148 | // NB (f, path) to be replaced by fs.Dir at some point |
| 149 | func 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) |
searching dependent graphs…