Automatic parent directory creation helper func.