MCPcopy Index your code
hub / github.com/rclone/rclone / SetModTime

Method SetModTime

backend/filescom/filescom.go:772–787  ·  view source on GitHub ↗

SetModTime sets the modification time of the local fs object

(ctx context.Context, modTime time.Time)

Source from the content-addressed store, hash-verified

770
771// SetModTime sets the modification time of the local fs object
772func (o *Object) SetModTime(ctx context.Context, modTime time.Time) (err error) {
773 params := files_sdk.FileUpdateParams{
774 Path: o.fs.absPath(o.remote),
775 ProvidedMtime: &modTime,
776 }
777
778 var file files_sdk.File
779 err = o.fs.pacer.Call(func() (bool, error) {
780 file, err = o.fs.fileClient.Update(params, files_sdk.WithContext(ctx))
781 return shouldRetry(ctx, err)
782 })
783 if err != nil {
784 return err
785 }
786 return o.setMetaData(&file)
787}
788
789// Storable returns a boolean showing whether this object storable
790func (o *Object) Storable() bool {

Callers 1

DirSetModTimeMethod · 0.95

Calls 5

setMetaDataMethod · 0.95
shouldRetryFunction · 0.70
UpdateMethod · 0.65
absPathMethod · 0.45
CallMethod · 0.45

Tested by

no test coverage detected