baseimage-tutorial-framework/lib/tfw/components/pipe_io_server/pipe.py
2019-05-13 10:08:59 +02:00

17 lines
369 B
Python

from os import mkfifo, remove, chmod
from os.path import exists
class Pipe:
def __init__(self, path):
self.path = path
def recreate(self, permissions):
self.remove()
mkfifo(self.path)
chmod(self.path, permissions) # use chmod to ignore umask
def remove(self):
if exists(self.path):
remove(self.path)