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

Method SetModTime

backend/hasher/object.go:150–155  ·  view source on GitHub ↗

SetModTime sets the modification time of the file. Also prunes the cache entry when modtime changes so that touching a file will trigger checksum recalculation even on backends that don't provide modTime with fingerprint.

(ctx context.Context, mtime time.Time)

Source from the content-addressed store, hash-verified

148// touching a file will trigger checksum recalculation even
149// on backends that don't provide modTime with fingerprint.
150func (o *Object) SetModTime(ctx context.Context, mtime time.Time) error {
151 if mtime != o.Object.ModTime(ctx) {
152 _ = o.f.pruneHash(o.Remote())
153 }
154 return o.Object.SetModTime(ctx, mtime)
155}
156
157// Open opens the file for read.
158// Full reads will also update object hashes.

Callers

nothing calls this directly

Calls 4

RemoteMethod · 0.95
pruneHashMethod · 0.80
ModTimeMethod · 0.65
SetModTimeMethod · 0.65

Tested by

no test coverage detected