MCPcopy
hub / github.com/rclone/rclone / SetModTime

Method SetModTime

backend/union/entry.go:130–149  ·  view source on GitHub ↗

SetModTime sets the metadata on the object to set the modification date

(ctx context.Context, t time.Time)

Source from the content-addressed store, hash-verified

128
129// SetModTime sets the metadata on the object to set the modification date
130func (o *Object) SetModTime(ctx context.Context, t time.Time) error {
131 entries, err := o.fs.actionEntries(o.candidates()...)
132 if err != nil {
133 return err
134 }
135 var wg sync.WaitGroup
136 errs := Errors(make([]error, len(entries)))
137 multithread(len(entries), func(i int) {
138 if o, ok := entries[i].(*upstream.Object); ok {
139 err := o.SetModTime(ctx, t)
140 if err != nil {
141 errs[i] = fmt.Errorf("%s: %w", o.UpstreamFs().Name(), err)
142 }
143 } else {
144 errs[i] = fs.ErrorNotAFile
145 }
146 })
147 wg.Wait()
148 return errs.Err()
149}
150
151// GetTier returns storage tier or class of the Object
152func (o *Object) GetTier() string {

Callers

nothing calls this directly

Calls 9

candidatesMethod · 0.95
UpstreamFsMethod · 0.95
ErrorsTypeAlias · 0.85
multithreadFunction · 0.85
actionEntriesMethod · 0.80
NameMethod · 0.65
WaitMethod · 0.65
ErrorfMethod · 0.45
ErrMethod · 0.45

Tested by

no test coverage detected