Created
October 15, 2015 11:20
-
-
Save matthiasvegh/30d8cd80451ee3885851 to your computer and use it in GitHub Desktop.
Recursive Dates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
import time | |
def main(): | |
rootDir = '/home/phil/workspace/clang-dump-names' | |
for dirName, subDirList, fileList in os.walk(rootDir): | |
depth = dirName.count(os.sep) - rootDir.count(os.sep) | |
indentation = '\t' * depth | |
print(indentation + dirName) | |
for fileName in fileList: | |
access = time.ctime(os.path.getatime(os.path.join(rootDir, dirName, fileName))) | |
creation = time.ctime(os.path.getctime(os.path.join(rootDir, dirName, fileName))) | |
modified = time.ctime(os.path.getmtime(os.path.join(rootDir, dirName, fileName))) | |
print(indentation + '\t' + fileName + ', accessed: ' + access + ', created: ' + creation + ', modified: ' + modified) | |
if __name__ == "__main__": | |
main() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment