Ensure that the target directory exists.