create directory hierarchy
-
Hi I want to create directory in hierarcy. For example I want to create c:\Test\Temp directory. Both test and temp directory do not exist. Thanks
and what have you tried so far to achieve this ? have you searched MSDN ?
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
-
and what have you tried so far to achieve this ? have you searched MSDN ?
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
I bet what he's looking for is an obscure function called something like
::DoMySpecialThingRightNow()
instead of an intuitive name like::CreateDirectory()
.... I mean, who would ever think of that... :rolleyes:"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown -
I bet what he's looking for is an obscure function called something like
::DoMySpecialThingRightNow()
instead of an intuitive name like::CreateDirectory()
.... I mean, who would ever think of that... :rolleyes:"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknowncertainly :-D
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
-
Hi I want to create directory in hierarcy. For example I want to create c:\Test\Temp directory. Both test and temp directory do not exist. Thanks
The Boost libraries have a create_directories () function that does precisely this. See http://www.boost.org/doc/libs/1_35_0/boost/filesystem/convenience.hpp[^]
-
I bet what he's looking for is an obscure function called something like
::DoMySpecialThingRightNow()
instead of an intuitive name like::CreateDirectory()
.... I mean, who would ever think of that... :rolleyes:"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknownWell
CreateDirectory
is useless. He actually needsCreateDirectoryHierarchy
... :-DIf the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
Hi I want to create directory in hierarcy. For example I want to create c:\Test\Temp directory. Both test and temp directory do not exist. Thanks
There's a lot of hard ways to do it... I prefer simple:
::SHCreateDirectory(NULL, L"c:\\Test\\Temp");
*edit* While easy, I just noticed SHCreateDirectory[Ex] is deprecated. Bummer.
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Hi I want to create directory in hierarcy. For example I want to create c:\Test\Temp directory. Both test and temp directory do not exist. Thanks
Can you more explain because your answer is easy and you can saw some answers of friends?
-
Hi I want to create directory in hierarcy. For example I want to create c:\Test\Temp directory. Both test and temp directory do not exist. Thanks
-
I bet what he's looking for is an obscure function called something like
::DoMySpecialThingRightNow()
instead of an intuitive name like::CreateDirectory()
.... I mean, who would ever think of that... :rolleyes:"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknownHi, Actually CreateDirectory does not create all directories in hierarchy. I solved this problem by using MakeSureDirectoryPathExists. Thanks.
-
Can you more explain because your answer is easy and you can saw some answers of friends?
Hi Hamid, Actually I want to create directory hierarcy using one api. CreateDirectory does not create directory hierarchy. I got MakeSureDirectoryPathExists API. If fulfils my requirement. Thanks
-
Well
CreateDirectory
is useless. He actually needsCreateDirectoryHierarchy
... :-DIf the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]Hi, CreateDirectory does not create directory hierarchy. I would have to create each directory in hierarchy. I got solution. MakeSureDirectoryPathExists creates directory hierarchy. Thanks
-
There's a lot of hard ways to do it... I prefer simple:
::SHCreateDirectory(NULL, L"c:\\Test\\Temp");
*edit* While easy, I just noticed SHCreateDirectory[Ex] is deprecated. Bummer.
Mark Salsbery Microsoft MVP - Visual C++ :java:
Hi, I used 'SHCreateDirectory' but got 'SHCreateDirectory': undeclared identifier. CreateDirectory API does not suite to my requirement becuase it creates directory only if parent directory exist. I got MakeSureDirectoryPathExists API which fulfil my requirements. Thanks for your help.
-
Please find the code below Using System.IO; //for creating the directory Directory.CreateDirectory("c:\\Test"); Directory.CreateDirectory("c:\\Test\\Temp");
Cheers!! Brij
Hi, I was looking for WIN32 API. I got MakeSureDirectoryPathExists API. Thanks for your help.
-
The Boost libraries have a create_directories () function that does precisely this. See http://www.boost.org/doc/libs/1_35_0/boost/filesystem/convenience.hpp[^]
Hi, I got the solution. I use MakeSureDirectoryPathExists API. Thanks for your response.