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

Method SetModTime

backend/union/entry.go:258–277  ·  view source on GitHub ↗

SetModTime sets the metadata on the DirEntry to set the modification date If there is any other metadata it does not overwrite it.

(ctx context.Context, t time.Time)

Source from the content-addressed store, hash-verified

256//
257// If there is any other metadata it does not overwrite it.
258func (d *Directory) SetModTime(ctx context.Context, t time.Time) error {
259 entries, err := d.fs.actionEntries(d.candidates()...)
260 if err != nil {
261 return err
262 }
263 var wg sync.WaitGroup
264 errs := Errors(make([]error, len(entries)))
265 multithread(len(entries), func(i int) {
266 if d, ok := entries[i].(*upstream.Directory); ok {
267 err := d.SetModTime(ctx, t)
268 if err != nil {
269 errs[i] = fmt.Errorf("%s: %w", d.UpstreamFs().Name(), err)
270 }
271 } else {
272 errs[i] = fs.ErrorIsFile
273 }
274 })
275 wg.Wait()
276 return errs.Err()
277}
278
279// Check the interfaces are satisfied
280var (

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