Create subdirectories if they do not exist.