MCPcopy
hub / github.com/rclone/rclone / Purge

Method Purge

backend/cache/cache.go:1716–1734  ·  view source on GitHub ↗

Purge all files in the directory

(ctx context.Context, dir string)

Source from the content-addressed store, hash-verified

1714
1715// Purge all files in the directory
1716func (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
1737func (f *Fs) CleanUp(ctx context.Context) error {

Callers

nothing calls this directly

Calls 3

InfofFunction · 0.92
PurgeMethod · 0.65
FeaturesMethod · 0.65

Tested by

no test coverage detected