should be
   old = input ? input.dup : nil

However, a duration of time must be specified to wait for the pipe or
timeout.  So I guess IO is pain :)