Skip to content

Instantly share code, notes, and snippets.

@csabatini
Created December 1, 2017 20:05
Show Gist options
  • Save csabatini/fb3cc3c6187d9b3141dc84b341f375af to your computer and use it in GitHub Desktop.
Save csabatini/fb3cc3c6187d9b3141dc84b341f375af to your computer and use it in GitHub Desktop.
import os
from datetime import datetime
directory = './test'
for filename in os.listdir(directory):
filepath = directory + '/' + filename
filestats = os.stat(filepath)
print '{} - {} - {} - {}'.format(
filepath, filestats.st_size, datetime.fromtimestamp(os.path.getctime(filepath)), datetime.fromtimestamp(os.path.getmtime(filepath))
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment