modify the _call method to allow stdout and stderr to be written to a file supplied as an argument