From b4f4029fa306b2753357c5f9c3e53968c3ba8e08 Mon Sep 17 00:00:00 2001 From: Henri Herscher Date: Mon, 19 Feb 2007 19:36:46 +0000 Subject: Moved recursive mkdir function to Utils. git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@411 09dcff7a-b715-0410-9601-b79a96267cd0 --- orkbasecxx/Utils.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'orkbasecxx/Utils.cpp') 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 -- cgit v1.2.3