def read_eventrec(path): """ read lsb.streams """ if lsf.lsb_init("test") > 0: exit(1) s = lsf.lsbStream() s.streamFile = path s.maxStreamSize = 1024 * 1024 * 1024 s.maxStreamFileNum = 10 cc = lsf.lsb_openstream(s) if cc < 0: print("Cannot open the file %s. Ensure you are the file owner." % (path)) exit(1) lineNum = lsf.new_intp() lsf.intp_assign(lineNum, 0) flag = 1 while flag > 0: log = lsf.lsb_readstream(lineNum) if log: display(log) else: flag = 0 lsf.lsb_closestream(path)
def read_eventrec(path): """ read lsb.streams """ if lsf.lsb_init("test") > 0: exit(1) s = lsf.lsbStream() s.streamFile = path; s.maxStreamSize = 1024*1024*1024 s.maxStreamFileNum = 10; cc = lsf.lsb_openstream(s) if cc < 0 : print("Cannot open the file %s. Ensure you are the file owner." % (path)) exit(1); lineNum = lsf.new_intp() lsf.intp_assign(lineNum, 0) flag = 1 while flag > 0: log = lsf.lsb_readstream(lineNum) if log: display(log) else: flag = 0
def read_eventrec(path): """ read lsb.streams """ s = lsf.lsbStream() s.streamFile = path; s.maxStreamSize = 1024*1024*1024 s.maxStreamFileNum = 10; lsf.lsb_openstream(s) lineNum = lsf.new_intp() lsf.intp_assign(lineNum, 0) flag = 1 if lsf.lsb_init("test") > 0: exit(1) while flag > 0: log = lsf.lsb_readstream(lineNum) if log: display(log) else: flag = 0