Add options to read input from file instead of STDIN.
Optionally reopen input when the end has been reached.
This is useful for FIFOs, to wait for the next writer.