void RelaxEngine::fixFolder(const QString pathToFolder) { RELAX_BEGIN_COPY; CopyList filesToCopy; QStringList pathToScan; pathToScan.append(pathToFolder); #ifdef Q_OS_LINUX if(scanNested) trav_dirs(filesToCopy, pathToScan, paths.listPairs); else prepareFiles(filesToCopy, pathToScan, paths.listPairs); future->setFuture(QtConcurrent::map(filesToCopy, lin_move)); #else prepareFiles(filesToCopy, pathToScan, paths.listPairs); future->setFuture(QtConcurrent::map(filesToCopy, copyFiles)); #endif future->waitForFinished(); sessionTransfer.push(filesToCopy); RELAX_END_COPY; }
void RelaxEngine::prepareFileCopy() { if(paths.baseFilePaths.isEmpty() || paths.listPairs.isEmpty() ){ qDebug() << "no files found";//premature calling of this function return; } CopyList filesList;//list to hold pairs of file sources and destination RELAX_BEGIN_COPY; #ifdef Q_OS_LINUX if(scanNested) trav_dirs(filesList, paths.baseFilePaths, paths.listPairs); else prepareFiles(filesList, paths.baseFilePaths, paths.listPairs); future->setFuture(QtConcurrent::map(filesList, lin_move)); #else prepareFiles(filesList, paths.baseFilePaths, paths.listPairs); future->setFuture(QtConcurrent::map(filesList, copyFiles)); #endif future->waitForFinished(); sessionTransfer.push(filesList); RELAX_END_COPY; }
void Engine::initialize() { prepareFiles(); ofstream fout(logFile); if (!fout) { cerr << "unable to create " << logFile << '\n'; //exit(1); } { time_t rawtime; tm* timeinfo; time(&rawtime); timeinfo = localtime(&rawtime); fout << "log begun at " << asctime(timeinfo) << "\n\n"; } ifstream fin(configFile); if (fin) { fin >> mConfig; fin.close(); } else {
cLogDataSource::cLogDataSource( const QString &p_qsInputDir, const QString &p_qsFiles ) throw() { cTracer obTracer( &g_obLogger, "cLogDataSource::cLogDataSource", QString( "inputdir: \"%1\", files: \"%2\"" ).arg( p_qsInputDir ).arg( p_qsFiles ).toStdString() ); parseFileNames( p_qsInputDir, p_qsFiles ); prepareFiles(); }
int main(int argc, char** argv) { // main2(argc, argv); int info_fd; int log_fd; unsigned int speep_time_microseconds = 500*1000; options* opt = initProgram(argc, argv); prepareFiles(info_fd, log_fd, opt); int i = 1; while (do_work) // until sigint won't interrupt { work(info_fd, log_fd); usleep(speep_time_microseconds); printf("Appended %d entries\n", i++); } terminateProgram(info_fd, log_fd, opt); return 0; }