Adding a mkdirs() to create directories for nested source directories.

Currently any source paths fail silently when trying to write to a nested location. This patch ensures a parent directory.