I am trying to write a python script to list all files with absolute path in a given directory recursively and list their UID and file owners in front of them. (something like: ls -lR ) I wrote this one but it gives me an error at the end of execution:
import os
for folder, subfolders, files in os.walk(os.getcwd()):
for file in files:
filePath = os.path.abspath(file)
print(filePath, os.stat(file).st_uid)