Miscellaneous Debris

Avner Kashtan's Frustrations and Exultations
Creating nested directories

Just a quick tip to prevent others from feeling as foolish as I do:

The static CreateDirectory() method of the System.IO.Directory class will create the entire directory tree passed to it. There's no need to write an EnsurePathExists() method that recursively creates the folders. Absolutely no need. Not even just to be safe. It works. Trust me. Trust the framework. The framework is your friend.

[This has been a public service announcement by the Society for the Reinvention of the Wheel]

Published Monday, May 22, 2006 1:30 PM by AvnerK

Filed under:

Comments

No Comments

Leave a Comment

(required) 
(required) 
(optional)
(required)