piping readable stream to writeable, outputting a file