From 11903063211dc368d03f52e090e52ab18ebe3f47 Mon Sep 17 00:00:00 2001 From: marha Date: Thu, 27 Jan 2011 13:44:12 +0000 Subject: Implemented mkdir as an internal command --- tools/mhmake/src/util.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tools/mhmake/src/util.cpp') diff --git a/tools/mhmake/src/util.cpp b/tools/mhmake/src/util.cpp index 9b34b41ea..46f9b9edb 100644 --- a/tools/mhmake/src/util.cpp +++ b/tools/mhmake/src/util.cpp @@ -746,6 +746,23 @@ void loadedmakefile::LoadMakefile() } } +/*****************************************************************************/ +bool MakeDirs(const fileinfo *pDir) +{ + fileinfo *pParentDir=pDir->GetDir(); + if (!pParentDir->GetDate().DoesExist()) + { /* First make parent dirs */ + if (!MakeDirs(pParentDir)) + return false; + } + if (!pDir->GetDate().DoesExist()) + { /* Create directory */ + if (-1==mkdir(pDir->GetFullFileName().c_str(),S_IRWXU)) + return false; + } + return true; +} + #ifdef _DEBUG /////////////////////////////////////////////////////////////////////////////// void DumpVarsAndRules() -- cgit v1.2.3