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]

Posted: May 22 2006, 01:30 PM by AvnerK | with 1 comment(s) |
Filed under:

Comments

Yasunari Tosa said:

Thanks (after seeing those crazy codes parsing the file separaters.  I was getting sick).

Java.IO has explicit mkdirs() for nexted creations.

# January 4, 2010 3:46 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)