Skip to content

Instantly share code, notes, and snippets.

@moretea
Last active June 27, 2020 12:55
Show Gist options
  • Save moretea/516537373bf6a231525655abf658bce1 to your computer and use it in GitHub Desktop.
Save moretea/516537373bf6a231525655abf658bce1 to your computer and use it in GitHub Desktop.
# https://github.com/winpython/winpython/releases/download/2.3.20200530/Winpython64-3.7.7.1.exe
import glob
import os
import os.path
to_process = ["."]
while len(to_process) > 0:
item = to_process[0]
to_process=to_process[1:]
file_name = item.replace("/","\\")
if os.path.islink(item):
target = os.readlink(item)
print("link", file_name, target)
elif os.path.isfile(item):
stat = os.stat(item)
print("file", file_name, stat.st_size)
elif os.path.isdir(item):
item_glob = os.path.join(item, "*")
files = glob.glob(item_glob)
sorted(files)
to_process.extend(files)
else:
print("unepxected file", item)
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment