Invoke toDir.mkdirs() if it does not exist.

Signed-off-by: Thomas Jespersen <laumann.thomas@gmail.com>