New: report output to a file (fixes #1027)