MCPcopy
hub / github.com/rclone/rclone / Close

Method Close

backend/mega/mega.go:1117–1132  ·  view source on GitHub ↗

Close closed the file - MAC errors are reported here

()

Source from the content-addressed store, hash-verified

1115
1116// Close closed the file - MAC errors are reported here
1117func (oo *openObject) Close() (err error) {
1118 oo.mu.Lock()
1119 defer oo.mu.Unlock()
1120 if oo.closed {
1121 return nil
1122 }
1123 err = oo.o.fs.pacer.Call(func() (bool, error) {
1124 err = oo.d.Finish()
1125 return shouldRetry(oo.ctx, err)
1126 })
1127 if err != nil {
1128 return fmt.Errorf("failed to finish download: %w", err)
1129 }
1130 oo.closed = true
1131 return nil
1132}
1133
1134// Open an object for read
1135func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.ReadCloser, err error) {

Callers

nothing calls this directly

Calls 5

shouldRetryFunction · 0.70
LockMethod · 0.65
UnlockMethod · 0.65
CallMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected