pipe-io-server/pipe_io_server/pipe.py

19 lines
327 B
Python

from os import mkfifo, remove
from os.path import exists
class Pipe:
def __init__(self, path):
self.path = path
def recreate(self):
self.remove()
self.create()
def remove(self):
if exists(self.path):
remove(self.path)
def create(self):
mkfifo(self.path)