Last active
December 17, 2015 14:09
-
-
Save basilleaf/5621968 to your computer and use it in GitHub Desktop.
look for files locally that do not have READ permission.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
""" | |
recursively crawls directory | |
if any file does not have READ permission | |
squawks to stdout | |
""" | |
import os | |
directory = '/path/to/directory/' | |
found = False | |
for (path, dirs, files) in os.walk(directory, followlinks=False): | |
for f in files: | |
if not os.access(f, os.R_OK): | |
print('Please report to Sick Bay: ' + path + '/' + f) | |
found = True | |
if not found: | |
print("All files are READ ok") | |
print("You are in command of the Bridge.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment