Create Missing Folder along the path

Posted by Ilya Biryukov on Stack Overflow See other posts from Stack Overflow or by Ilya Biryukov
Published on 2010-05-06T10:12:22Z Indexed on 2010/05/06 10:18 UTC
Read the original article Hit count: 186

Filed under:
|

I have a path for example C:\files\dir\file.css

The "files" directory exists. however, the dir directory is missing and needs to be created.

When I try to create the file using File.Create, it throws an exception saying that the directory was not found.

Is there any way to make .net to create the missing folders along the path for me?

Thanks

© Stack Overflow or respective owner

Related posts about c#

Related posts about folders