def writestate(self, state):
        try:
            f = open(os.path.join(self.sessiondir, "state"), "w")
            f.write("%d %s\n" % (state, coreapi.state_name(state)))
            f.close()
        except Exception, e:
            self.warn("Error writing state file: %s" % e)
Write the current state to a state file in the session dir.
dataset/ETHPy150Open coreemu/core/daemon/core/session.py/Session.writestate