Purge all files in the directory
(ctx context.Context, dir string)
| 1714 | |
| 1715 | // Purge all files in the directory |
| 1716 | func (f *Fs) Purge(ctx context.Context, dir string) error { |
| 1717 | if dir == "" { |
| 1718 | // FIXME this isn't quite right as it should purge the dir prefix |
| 1719 | fs.Infof(f, "purging cache") |
| 1720 | f.cache.Purge() |
| 1721 | } |
| 1722 | |
| 1723 | do := f.Fs.Features().Purge |
| 1724 | if do == nil { |
| 1725 | return fs.ErrorCantPurge |
| 1726 | } |
| 1727 | |
| 1728 | err := do(ctx, dir) |
| 1729 | if err != nil { |
| 1730 | return err |
| 1731 | } |
| 1732 | |
| 1733 | return nil |
| 1734 | } |
| 1735 | |
| 1736 | // CleanUp the trash in the Fs |
| 1737 | func (f *Fs) CleanUp(ctx context.Context) error { |