switch output to using a writeStream
make path if needed
pipe output to file