def open( path, mode = 'r', permissions = None): if __check_authentication( path, mode, permissions): if check_exists( path, permissions): return PALDatastore.open( path, mode ) return False
def append( path, blob, permissions = None ): if __check_authentication( path, 'a', permissions): if check_exists( path, permissions ): file_handle = PALDatastore.open( path, 'a') file_handle.write(blob) return True else: return False else: return False
def add_file( path, name = None, blob = None, mode = None, permissions = None ): if check_exists( path, permissions ): return False else: file_handle = PALDatastore.open(path,'w') if file_handle is None: return False if blob is not None: file_handle.write(blob) file_handle.close() userobj = users.get_current_user() permis = Permissions(True,True,True) __add_authentication(path, name, userobj, permis) if mode is None: return False else: return PALDatastore.open(path, mode)
def add_directory( path, permissions = None ): if check_exists(path, permissions): return False else: if check_exists(get_container(path),permissions): file_handle = PALDatastore.open(path, 'w') if file_handle is None: return False else: file_handle.close(); return True else: return False