StrList FileSystemManager::getWorkingDirectoryContents(QString filter) { if (!scnManager->getCurrentLibrary()) return getDirectoryContents(native(scnManager->getWorkingDirectory()), filter); StrList files; QListIterator<QString> dirIt(scnManager->getCurrentLibrary()->getFolderPaths()); while (dirIt.hasNext()) { StrList list = getDirectoryContents(dirIt.next(), filter); files.insert(files.end(), list.begin(), list.end()); } return files; }
void SimUtilities::removeExcessArchivedRuns() { // Information about each run is stored in the run/ directory. As it turns // out, this information can pile up pretty quickly. We should remove the // oldest stuff so that the run/ directory doesn't get too full. std::vector<std::string> contents = getDirectoryContents(Directory::getRunDirectory()); std::sort(contents.begin(), contents.end()); for (int i = 2; i < static_cast<int>(contents.size()) - P()->numberOfArchivedRuns(); i += 1) { #ifdef _WIN32 // TODO: upforgrabs // Implement a windows version of directory removal #else system((std::string("rm -rf \"") + contents.at(i) + std::string("\"")).c_str()); #endif } }