(self, filemode=0o600, dirmode=0o700, mask=0o755, recursive=False)
return True
chmod directory recursively
chmod directory recursively
chmod directory recursively
def chmod(self, filemode=0o600, dirmode=0o700, mask=0o755, recursive=False):
        """chmod directory recursively"""
        try:
            if recursive:
                for dir_path, dirs, files in os.walk(self.filename):
                    for f_name in files:
                        self._chmod(dir_path + '/' + f_name,
                                    filemode, None, mask)
                    for f_name in dirs:
                        self._chmod(dir_path + '/' + f_name,
                                    None, dirmode, mask)
            self._chmod(self.filename, filemode, dirmode, mask)
        except OSError:
            return False
        return True
def chmod ( self , filemode = 0o600 , dirmode = 0o700 , mask = 0o755 , recursive = False ) : try : if recursive : for dir_path , dirs , files in os . walk ( self . filename ) : for f_name in files : self . _chmod ( dir_path + '/' + f_name , filemode , None , mask ) for f_name in dirs : self . _chmod ( dir_path + '/' + f_name , None , dirmode , mask ) self . _chmod ( self . filename , filemode , dirmode , mask ) except OSError : return False return True