Skip to content

Instantly share code, notes, and snippets.

@msuhanov
Created December 12, 2018 23:52
Show Gist options
  • Save msuhanov/74fd3c795883e0491277e6e27f2434e3 to your computer and use it in GitHub Desktop.
Save msuhanov/74fd3c795883e0491277e6e27f2434e3 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import os
from time import sleep
FILE_PATH = 'ts.txt'
def get_atime_1():
result = os.stat(FILE_PATH, follow_symlinks = False)
return result.st_atime
def get_atime_2():
for entry in os.scandir('.'):
if entry.name.lower() == FILE_PATH.lower():
return entry.stat().st_atime
#print('Starting up...')
#sleep(15)
print(get_atime_1(), get_atime_2())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment