def RestartCapture(self):
"""Resume capturing output to a file (after calling StopCapture)."""
# Original stream fd
assert self._uncaptured_fd
# Append stream to file
cap_fd = os.open(self._filename,
os.O_CREAT | os.O_APPEND | os.O_WRONLY,
0600)
# Send stream to this file
self._stream.flush()
os.dup2(cap_fd, self._fd)
os.close(cap_fd)
评论列表
文章目录