Add creating parent directories if necessary.