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

Method ModTime

backend/oracleobjectstorage/object.go:273–293  ·  view source on GitHub ↗

ModTime returns the modification time of the object It attempts to read the objects mtime and if that isn't present the LastModified returned to the http headers

(ctx context.Context)

Source from the content-addressed store, hash-verified

271// It attempts to read the objects mtime and if that isn't present the
272// LastModified returned to the http headers
273func (o *Object) ModTime(ctx context.Context) (result time.Time) {
274 if o.fs.ci.UseServerModTime {
275 return o.lastModified
276 }
277 err := o.readMetaData(ctx)
278 if err != nil {
279 fs.Logf(o, "Failed to read metadata: %v", err)
280 return time.Now()
281 }
282 // read mtime out of metadata if available
283 d, ok := o.meta[metaMtime]
284 if !ok || d == "" {
285 return o.lastModified
286 }
287 modTime, err := swift.FloatStringToTime(d)
288 if err != nil {
289 fs.Logf(o, "Failed to read mtime from object: %v", err)
290 return o.lastModified
291 }
292 return modTime
293}
294
295// SetModTime sets the modification time of the local fs object
296func (o *Object) SetModTime(ctx context.Context, modTime time.Time) error {

Callers

nothing calls this directly

Calls 2

readMetaDataMethod · 0.95
LogfFunction · 0.92

Tested by

no test coverage detected