Reputation: 656
I wrote a simple code to check specific directory's last access time.
Below code always prints the first execution time of this script.
Another call of this script does not updating it. It always shows the same time Wed Dec 16 14:31:38 2020
.
How can I get the actual last access time without modifying it from the script call?
import os
import time
import re
result = {}
for root, dirs, files in os.walk('/data/samples/'):
if re.search(r'.*/[0-9a-f]{40}$', root):
print(root, time.ctime(os.stat(root)).st_atime)
('/data/samples/a/b/c/4564564564564564564564564564564564564564', 'Wed Dec 16 14:31:38 2020')
('/data/samples/d/e/f/1231231231231231231231231231231231231231', 'Wed Dec 16 14:31:38 2020')
...
Upvotes: 0
Views: 146
Reputation:
Maybe this can help:
If you actually want the Last Access date updated the way it used to be, simply set the registry value to 0.
Upvotes: 0