diff options
author | Henri Herscher <henri@oreka.org> | 2007-02-19 19:36:46 +0000 |
---|---|---|
committer | Henri Herscher <henri@oreka.org> | 2007-02-19 19:36:46 +0000 |
commit | b4f4029fa306b2753357c5f9c3e53968c3ba8e08 (patch) | |
tree | bffcc2dac317244fd77645465a45bde32dd8b388 /orkbasecxx/Utils.cpp | |
parent | 51e937e678323ceb3079e3ecafb1e8f78e59be11 (diff) |
Moved recursive mkdir function to Utils.
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@411 09dcff7a-b715-0410-9601-b79a96267cd0
Diffstat (limited to 'orkbasecxx/Utils.cpp')
-rw-r--r-- | orkbasecxx/Utils.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/orkbasecxx/Utils.cpp b/orkbasecxx/Utils.cpp index d4e7f8a..d1139ba 100644 --- a/orkbasecxx/Utils.cpp +++ b/orkbasecxx/Utils.cpp @@ -1,6 +1,7 @@ #include "Utils.h" #include "ace/OS_NS_stdio.h" #include "ace/OS_NS_arpa_inet.h" +#include "ace/OS_NS_sys_stat.h" //======================================================== // file related stuff @@ -65,6 +66,25 @@ bool FileCanOpen(CStdString& path) return false; } +void FileRecursiveMkdir(CStdString& path) +{ + int position = 0; + bool done = false; + while (!done) + { + position = path.Find('/', position+1); + if (position == -1) + { + done = true; + } + else + { + CStdString level = path.Left(position); + ACE_OS::mkdir((PCSTR)level); + } + } +} + //===================================================== // Network related stuff |