Skip to content

Instantly share code, notes, and snippets.

@labeneator
Last active January 4, 2016 20:59
Dummy writer prevents a fifo from sending EOFs to all readers when the real writer exits.
while True:
self.logger.info("[Re]starting to read %s" % self.input_file)
with open(self.input_file, "rb") as f:
f1 = open (fname, "w") # The dummy writer has to be opened after a reader, otherwise it would block
for line in f:
...do_stuff_with_line...(line)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment