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

Method Purge

backend/union/union.go:242–263  ·  view source on GitHub ↗

Purge all files in the directory Implement this if you have a way of deleting all the files quicker than just running Remove() on the result of List() Return an error if it doesn't exist

(ctx context.Context, dir string)

Source from the content-addressed store, hash-verified

240//
241// Return an error if it doesn't exist
242func (f *Fs) Purge(ctx context.Context, dir string) error {
243 for _, r := range f.upstreams {
244 if r.Features().Purge == nil {
245 return fs.ErrorCantPurge
246 }
247 }
248 upstreams, err := f.action(ctx, "")
249 if err != nil {
250 return err
251 }
252 errs := Errors(make([]error, len(upstreams)))
253 multithread(len(upstreams), func(i int) {
254 err := upstreams[i].Features().Purge(ctx, dir)
255 if errors.Is(err, fs.ErrorDirNotFound) {
256 err = nil
257 }
258 if err != nil {
259 errs[i] = fmt.Errorf("%s: %w", upstreams[i].Name(), err)
260 }
261 })
262 return errs.Err()
263}
264
265// Copy src to this remote using server-side copy operations.
266//

Callers

nothing calls this directly

Calls 9

actionMethod · 0.95
ErrorsTypeAlias · 0.85
multithreadFunction · 0.85
IsMethod · 0.80
FeaturesMethod · 0.65
PurgeMethod · 0.65
NameMethod · 0.65
ErrorfMethod · 0.45
ErrMethod · 0.45

Tested by

no test coverage detected