- obey(file.readline().rstrip(), io_db,
- file.prefix + str(file.line_n))
- file.line_n = file.line_n + 1
- try:
- while 1:
- obey(read_command(io_db), io_db, "in file", replay_file=file)
- except SystemExit:
- file.close()
- raise
+ line = io_db["file_record"].readline()
+ if "" == line:
+ break
+ obey(line.rstrip(), io_db, io_db["file_record"].prefix
+ + str(io_db["file_record"].line_n))
+ io_db["file_record"].line_n = io_db["file_record"].line_n + 1
+ while True:
+ obey(read_command(io_db), io_db, "in file", replay=True)