I have what I think is probably quite a simple question to answer (for someone). Given a path, say C:\A\B\C\D\, what is the most efficient, compact and elegant way to re-create that path on the system, assuming it doesn’t already exist (C:\A\B might, of course), in c#?
The only thing I can think of involves a rather grubby looking little path parser, with all of the potential pit-falls this entails. I’m sure many people here will have encountered this little problem before and have a better solution than I can come up with.
So, your thoughts please gentlemen (and ladies)?
System.IO.Directory.CreateDirectory(@"C:\A\B\C\D\")will do just fine.