def delete(file): if exists(file): os.remove( io.absolute_path(file, __dirname) ) return True return False
def write(data, file): file_existed = True if exists(file) else False io.write_file( data, io.absolute_path(file, __dirname), ) return file_existed
def exists(file = '', isState = False): file = io.absolute_path(file, __dirname, isState) return os.path.exists(file)
def get_state(file = 'state'): if exists(file, True): return io.readFile(io.absolute_path(file, __dirname, True)) return False
def set_state(data): return io.write_file( data, io.absolute_path('state', __dirname, True), )
def read(file): if exists(file): return io.readFile( io.absolute_path(file, __dirname), )