Created
September 5, 2017 04:14
-
-
Save handakumbura/1897c7635b90ca0b71a74973757d160e to your computer and use it in GitHub Desktop.
kt_articlethree_3
This file contains hidden or 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
import os | |
folder="/home/dumiduh/pythonian/" | |
files=os.listdir(folder) | |
for file in files: | |
fqfilename=folder+str(file) | |
os.chown(fqfilename,1000,1000) | |
os.chmod(fqfilename,0660) | |
modemasked=os.stat(fqfilename).st_mode | |
uid=os.stat(fqfilename).st_uid | |
gid=os.stat(fqfilename).st_gid | |
modebits=bin(modemasked)[-9:] | |
print 'Permissions and ownership were modified..' | |
print fqfilename,uid,gid,modemasked,modebits | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment