def open(self, flags):
if self._fd is None:
if not os.path.exists(self.path):
raise Exception('Input pipe does not exist: %s' % self._path)
if not stat.S_ISFIFO(os.stat(self.path).st_mode):
raise Exception('Input pipe must be a fifo object: %s' % self._path)
try:
self._fd = os.open(self.path, flags)
except OSError as e:
if e.errno != errno.ENXIO:
raise e
评论列表
文章目录