use line buffering when operating on stdin, block buffering when operating on files