Skip to content

Instantly share code, notes, and snippets.

@hkwi
Last active August 29, 2015 14:17
Show Gist options
  • Save hkwi/c8184f284bd1c164b53f to your computer and use it in GitHub Desktop.
Save hkwi/c8184f284bd1c164b53f to your computer and use it in GitHub Desktop.
import os
import sys
import json
info = []
for root,dirs,files in os.walk(sys.argv[1]):
for dir in dirs:
path = os.path.join(root, dir)
info.append({"path": path, "lstat":str(os.lstat(path)}))
for file in files:
path = os.path.join(root, file)
info.append({"path": path, "lstat":str(os.lstat(path)}))
json.dump(info, sys.stdout, indent=2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment