write intermediate output to file instead of RAM