I was working on a project where a recursive program would look through my computer to find a specific file. When it tries to open the recycle bin, the following error is produced: The function that produces this error is this:
def containsFile(path, filename):
print(path, os.access(path, os.R_OK))
for thing in os.listdir(path):
if(thing == filename):
return os.path.join(path, filename)
return False
I tried to test permissions for the file by printing os.access(path, os.R_OK)
to the console, but it says that I have access to the recycle bin in the console. Is there a way to check for files/folders I don't have access to? Thanks in advance.