mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 15:32:52 +02:00
lua_filehelpers.cpp: Add lua script function 'mkdir()'
- Set Lua api version to 1.52
Origin commit data
------------------
Branch: ni/coolstream
Commit: 906e9a2156
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2016-09-04 (Sun, 04 Sep 2016)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -882,6 +882,8 @@ bool CFileHelpers::copyDir(const char *Src, const char *Dst, bool backupMode)
|
||||
// false - errno is set
|
||||
bool CFileHelpers::createDir(string& Dir, mode_t mode)
|
||||
{
|
||||
CFileHelpers* fh = CFileHelpers::getInstance();
|
||||
fh->clearDebugInfo();
|
||||
int res = 0;
|
||||
for(string::iterator iter = Dir.begin() ; iter != Dir.end();) {
|
||||
string::iterator newIter = find(iter, Dir.end(), '/' );
|
||||
@@ -895,7 +897,12 @@ bool CFileHelpers::createDir(string& Dir, mode_t mode)
|
||||
// We can assume that if an error
|
||||
// occured, following will fail too,
|
||||
// so break here.
|
||||
dprintf(DEBUG_NORMAL, "[CFileHelpers %s] creating directory %s: %s\n", __func__, newPath.c_str(), strerror(errno));
|
||||
if (!fh->getConsoleQuiet())
|
||||
dprintf(DEBUG_NORMAL, "[CFileHelpers %s] creating directory %s: %s\n", __func__, newPath.c_str(), strerror(errno));
|
||||
char buf[1024];
|
||||
memset(buf, '\0', sizeof(buf));
|
||||
snprintf(buf, sizeof(buf)-1, "creating directory %s: %s", newPath.c_str(), strerror(errno));
|
||||
fh->setDebugInfo(buf, __path_file__, __func__, __LINE__);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user