Handle the difference between a pipe and a real file better.