Handle '/' characters in the output path name

and recover when the output file path cannot be found.