Example: Changing a retention setting

Content Platform Tenant Management Help

Version
9.7.x
File Size
4269 KB
Audience
anonymous
Part Number
MK-95HCPH002-19

This example extends the retention period for the wind.jpg object by one year. If this object is still open due to lazy close, changing the retention setting closes it.

Windows command

echo +1y > y:\images\wind.jpg\retention.txt

Python code

retention_value = "+1y"
retention_fh = file("y:\\images\\wind.jpg\\retention.txt")
try:
retention_fh.write(retention_value)
finally:
retention_fh.close()