Dec-17-2022, 03:26 AM
you can get the mode (and much more) by using stats
for example (run from script path -- modify path as required --, probably better to use pathlib):
modified from example here: https://docs.python.org/3/library/os.html#os.scandir
for example (run from script path -- modify path as required --, probably better to use pathlib):
modified from example here: https://docs.python.org/3/library/os.html#os.scandir
import os path = os.getcwd() with os.scandir(path) as it: for entry in it: if not entry.name.startswith('.') and entry.is_file(): stats = os.stat(path, follow_symlinks=False) print(stats)see https://docs.python.org/3/library/stat.html on how to interpret the stat results.