19 lines
327 B
Python
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)
|