mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-23 07:31:32 +00:00
17 lines
369 B
Python
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)
|