(self, uid=0, gid=0, recursive=False)
return True
Change ownership of file or directory
Change ownership of file or directory
Change ownership of file or directory
def chown(self, uid=0, gid=0, recursive=False):
        """Change ownership of file or directory"""
        try:
            if recursive:
                for dir_path, dirs, files in os.walk(self.filename):
                    for f_name in dirs + files:
                        os.lchown(dir_path + '/' + f_name, uid, gid)
            else:
                os.lchown(self.filename, uid, gid)
        except OSError:
            return False
        return True
def chown ( self , uid = 0 , gid = 0 , recursive = False ) : try : if recursive : for dir_path , dirs , files in os . walk ( self . filename ) : for f_name in dirs + files : os . lchown ( dir_path + '/' + f_name , uid , gid ) else : os . lchown ( self . filename , uid , gid ) except OSError : return False return True