listSubdirs is equivalent to `rclone lsf -R [--dirs-only]`
(ctx context.Context, remote string, DirsOnly bool)
| 1310 | |
| 1311 | // listSubdirs is equivalent to `rclone lsf -R [--dirs-only]` |
| 1312 | func (b *bisyncTest) listSubdirs(ctx context.Context, remote string, DirsOnly bool) error { |
| 1313 | f, err := cache.Get(ctx, remote) |
| 1314 | if err != nil { |
| 1315 | return err |
| 1316 | } |
| 1317 | |
| 1318 | opt := operations.ListJSONOpt{ |
| 1319 | NoModTime: true, |
| 1320 | NoMimeType: true, |
| 1321 | DirsOnly: DirsOnly, |
| 1322 | Recurse: true, |
| 1323 | } |
| 1324 | fmt := operations.ListFormat{} |
| 1325 | fmt.SetDirSlash(true) |
| 1326 | fmt.AddPath() |
| 1327 | printItem := func(item *operations.ListJSONItem) error { |
| 1328 | b.logPrintf("%s - filename hash: %s", fmt.Format(item), stringToHash(item.Name)) |
| 1329 | return nil |
| 1330 | } |
| 1331 | return operations.ListJSON(ctx, f, "", &opt, printItem) |
| 1332 | } |
| 1333 | |
| 1334 | // purgeChildren deletes child files and purges subdirs under given path. |
| 1335 | // Note: this cannot be done with filters. |
no test coverage detected