PMU_PIPE_MAP = {}
PIPE= 'tmp/%s.pipe' % hostname
if not os.path.exists(PIPE):
os.mkfifo(PIPE)
PMU_PIPE_MAP[hostname] = os.open(PIPE, os.O_WRONLY)
Im trying to open n pipes. In order to keep track of them I'd like to store them somehow - like in a dictionary - I thought that the above code should work but it freezes during execution. Any suggestions?
This does work however:
pipein = os.open(PIPE, os.O_WRONLY)
Aha! apparently there has to be a read on the other end before we can get a return from the pipe. So the question that I asked was not correct because I failed to test the two scenarios in the same way. So my problem was in understanding how pipes work. In this situation the dictionary entry will succeed once the piping is opened on the 'read' end but will block until then. how to determine if pipe can be written
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With