Last post May 01, 2014 11:20 PM by markfitzme
May 01, 2014 05:09 PM|cubangt|LINK
By this i mean we have a storage server that stores all our project documents, we have them split into 5 categories.. So when a new project is created, we want to create the 5
sub directory’s under the project root folder.
I know that Directory.CreateDirectory will create the path that you provide it, but do i have to call the Directory.CreateDirectory for each sub directory?
So I’m just looking for the proper and most efficient way to accomplish this. I was thinking i can just create an array of the subfolder and when i create the project folder,
i loop thru the array and create the subfolders after..
But is that the best way?
Any suggestion or links would be great.
May 01, 2014 11:20 PM|markfitzme|LINK
That's pretty much a good way to do it. Also, the action would be iterative anyways as it wouldn't be creating the directories as parallel tasks so the performance would be the same, an iterative loop of directory creation.
The activity though will create all the directories needed in the path according to: http://msdn.microsoft.com/en-us/library/system.io.directory.createdirectory(v=vs.110).aspx
So you shouldn't need to create a parent, then the children.