Example: Using atime to set retention

This example changes the value of the POSIX atime attribute for the wind.jpg object. If the namespace is configured to synchronize atime values with retention settings and the object has a retention setting that specifies a date or time in the future, this also changes the retention setting for the object.

Unix command

touch -a -t 201505171200 /datamount/images/wind.jpg

Python code

import os
mTime = os.path.getmtime("/datamount/images/wind.jpg")
aTime = 1431878400 #12:00 May 17th 2015
os.utime("/datamount/images/wind.jpg", (aTime, mTime))