Create directories if they don't exist.