예제 #1
0
void CloneThread::run()
{
    QStringList files;
    QStringList absoluteSourceFiles;
    QStringList absoluteDestinationFiles;
    quint64     totalSize;

    // Searching
    {
        emit OnProgressChanged(tr("Searching..."), 0, 0);

        if (!getFiles(files))
        {
            return;
        }

        if (!getAbsolutePaths(files, absoluteSourceFiles, absoluteDestinationFiles))
        {
            return;
        }

        printLists(files, absoluteSourceFiles, absoluteDestinationFiles);
    }

    // Calculating
    {
        emit OnProgressChanged(tr("Calculating..."), 0, 0);

        totalSize = getTotalSize(absoluteSourceFiles);

        if (mTerminated)
        {
            return;
        }

        qDebug() << "Total size: " << totalSize;
    }

    // Deleting
    {
        emit OnProgressChanged(tr("Deleting old folder..."), 0, 0);

        if (!deleteFolder(mDestinationPath))
        {
            return;
        }
    }

    // Cloning
    {
        if (!cloneFiles(absoluteSourceFiles, absoluteDestinationFiles, totalSize))
        {
            return;
        }
    }
}
예제 #2
0
void initLists(Bool printList)
{
    initAbsences();
    initAppointments();

    initConsultations();
    initDoctors();
    initPatients();
    initRooms();
    if(printList)
        printLists();
}
예제 #3
0
파일: sortNums.c 프로젝트: Deedasmi/CIS308
int main( int argc, char *argv[])
{
	//printf("%d",argc);
	if (argc == 2) {
		int c;
		char c2;
		int neg = 0;
		//not too many arguments
		FILE *fr = fopen(argv[1], "r");
		if (fr==0) {
		 	printf("Could not open file.\n"); 
		} else {
			fscanf(fr, "%d", &c);
			//First character
			int** numberList;
			numberList = (int**)malloc(c * sizeof(int*));
			int i = 0;
			int l;
			while (fscanf(fr,"%c",&c2) != EOF ) {
				l = 0;
				fscanf(fr, "%d%c", &c, &c2);
				numberList[i] = malloc(c * sizeof(int));
				i++;
				while (c2!='\n' && c2!=EOF) {
					fscanf(fr, "%d", &c);
					numberList[i - 1][l] = c;
					l++;
					fscanf(fr,"%c",&c2);
				}
				//free(&l);
			}
			//All values read in
			printf("Printing!");
			printLists(numberList);
			//free(numberList);
			fclose(fr);
			//free(fr);
		} 
		//Reading done
		

		//Sort stuff here


	} else { printf("Please provide one argument");}
	return 0;
}
예제 #4
0
파일: main.c 프로젝트: fossum/wsu_cs460
int body() {
    char c;
    printf("proc %d resumes to body()\n", running->pid);
    
    while(1) {
	printLists();
	printf("proc %d[%d] running: parent=%d\n",
	       running->pid, running->priority, running->ppid);
	
	printf("enter a char [Debug|Fork|Umode|Ps|Quit|Sleep|Wait] : ");
	c = getc(); printf("%c\n", c);
	switch(c) {
	    case 's' : tswitch();   break;
	    case 'f' : kfork();     break;
	    case 'q' : kexit();     break; 
	    case 'p' : kps();       break; 
	    case 'w' : kwait();     break;
	    case 'd' : debugStatement();	break;
            case 'u' : goUmode();   break;
	}
    }
}
예제 #5
0
파일: main.c 프로젝트: fossum/wsu_cs460
void debugStatement() {
    int flag = 1;
    char c;
    
    while (flag) {
	printf("Debug Point (l, n, p, num): ");
	c = getc();
	printf("\n");
	switch(c) {
	    case '0':
	    case '1':
	    case '2':
	    case '3':
	    case '4':
	    case '5':
	    case '6':
	    case '7':
	    case '8':
	    case '9':
		printProc(&proc[c-'0']);
		break;
	    case 'n':
		printf("nproc: %d\n", nproc);
		break;
	    case 'p':
		kps();
		break;
	    case 'l':
		printLists();
		break;
	    default:
		flag = 0;
		break;
	}
    }
}