Problem
Currently, if the output is a file, the entire parent tree is automatically created. This is surprising behavior given that when the output is a directory we require that the directory already exist.
Solution
If the output is a file, require that the immediate parent directory already exist.