The addition of this check is fine, but my previous comments (in an outdated diff now) still apply. I do not want the unconditional output if the dir does not already exist (and that is not an exceptional case). I agree that failure to create a dir (or if it is a pre-existing file) is an exceptional error, I just want the user to understand what happened. For that we need to output the directory etcetera, in case create_directories() throws.