这篇教程C++ CreateDirectoryA函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中CreateDirectoryA函数的典型用法代码示例。如果您正苦于以下问题:C++ CreateDirectoryA函数的具体用法?C++ CreateDirectoryA怎么用?C++ CreateDirectoryA使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了CreateDirectoryA函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: Logvoid leyrat::Callback_KeyLog(const char *ip, char*keylog){ Log("[R][%s] Uploaded KeyLog!/n", ip); CreateDirectoryA(ip, 0); time_t rawtime; tm* timeinfo; time (&rawtime); timeinfo = localtime (&rawtime); char sdate[50]; strftime(sdate, 50, "%F", timeinfo); std::string sfilename = ip; sfilename.append("/"); sfilename.append("keylog_"); sfilename.append(sdate); sfilename.append(".txt"); Log("[R][%s] Writing file to: %s/n", ip, sfilename.c_str()); FILE* f = fopen(sfilename.c_str(), "a+b"); if(!f) { f = fopen(sfilename.c_str(), "wb"); } if(!f) return; fwrite(keylog, sizeof(char), strlen(keylog), f); fclose(f);}
开发者ID:Leystryku,项目名称:leyrat,代码行数:39,
示例2: CCLOGvoid AssetsUpdateLayer::createDownloadedDir(){ m_pathToSave = CCFileUtils::sharedFileUtils()->getWritablePath(); m_pathToSave += "loaddir/"; CCLOG("writable path[%s]", m_pathToSave.c_str()); getAssetsManager()->setStoragePath(m_pathToSave.c_str());#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) DIR *pDir = NULL; pDir = opendir (m_pathToSave.c_str()); if (! pDir) { mkdir(m_pathToSave.c_str(), S_IRWXU | S_IRWXG | S_IRWXO); }#else if ((GetFileAttributesA(m_pathToSave.c_str())) == INVALID_FILE_ATTRIBUTES) { CreateDirectoryA(m_pathToSave.c_str(), 0); }#endif}
开发者ID:sharpfforg,项目名称:us,代码行数:22,
示例3: whilebool FilesDownload::downloadList(){ string base = "http://" + host + "/" + path; // On parcours la liste for (size_t i = 0; i < filesToDownload.size(); i++) { string file = filesToDownload[i]; size_t pos; string link; while( (pos = file.find("/")) != string::npos ) { link += file.substr(0, pos); if (!dirExists(link)) CreateDirectoryA(link.c_str(), NULL); link += "/"; file.erase(0, pos + 1); } link += file; // On télécharge le fichier if (!Download::download(base + link, link)) { printf("Erreur download: %s", link.c_str()); return false; } } return true;}
开发者ID:ParksProjets,项目名称:PProot,代码行数:38,
示例4: timevoid SessionServer::InitializeFileLogger(){ time_t curTime = time(NULL); tm curTM; localtime_s(&curTM, &curTime); if (!m_logWriter) { std::string filePath = s_defaultLogBaseLocation; filePath += "SharingServiceLogs"; filePath += "//"; BOOL dirResult = CreateDirectoryA(filePath.c_str(), NULL); if (dirResult || GetLastError() == ERROR_ALREADY_EXISTS) { // Either we succeeded in creating the directory or it already exists. std::string fileName = "SharingService_"; fileName += std::to_string(curTM.tm_year + 1900); fileName += std::to_string(curTM.tm_mon + 1); fileName += std::to_string(curTM.tm_mday); fileName += ".log"; std::string fullPath = filePath + GetLogFileName(curTM); m_logWriter = new FileLogWriter(); m_logWriter->AddTargetFile(fullPath); } } m_logger = new Logger(); m_logger->SetWriter(m_logWriter); std::string curTimeString = GetCurrentDateTimeString(curTM); LogInfo(" ** Logging Session Began at %s", curTimeString.c_str());}
开发者ID:Microsoft,项目名称:HoloToolkit,代码行数:38,
示例5: MakeSureDirectoryPathExists |