If the user specifies an input file, but output path that does not exist, the program currently crashes trying to check if the output path is a directory.
In this situation, first check if the output path exists, if not, guess if it should be a directory or file, and create it if necessary.
If the user specifies an input file, but output path that does not exist, the program currently crashes trying to check if the output path is a directory.
In this situation, first check if the output path exists, if not, guess if it should be a directory or file, and create it if necessary.