//loop through and create all the processes you want
while (process != processors) {
- int pid = fork();
+ pid_t pid = fork();
if (pid > 0) {
processIDS.push_back(pid); //create map from line number to pid so you can append files in correct order later
//pass numSeqs to parent
ofstream out;
- string tempFile = contigsreport + toString(getpid()) + ".num.temp";
+ string tempFile = contigsreport + m->mothurGetpid(process) + ".num.temp";
m->openOutputFile(tempFile, out);
out << num << endl;
//loop through and create all the processes you want
while (process != processors) {
- int pid = fork();
+ pid_t pid = fork();
if (pid > 0) {
processIDS.push_back(pid); //create map from line number to pid so you can append files in correct order later
//pass numSeqs to parent
ofstream out;
- string tempFile = alignreport + toString(getpid()) + ".num.temp";
+ string tempFile = alignreport + m->mothurGetpid(process) + ".num.temp";
m->openOutputFile(tempFile, out);
out << num << endl;
//loop through and create all the processes you want
while (process != processors) {
- int pid = fork();
+ pid_t pid = fork();
if (pid > 0) {
processIDS.push_back(pid); //create map from line number to pid so you can append files in correct order later
//pass numSeqs to parent
ofstream out;
- string tempFile = fastafile + toString(getpid()) + ".num.temp";
+ string tempFile = fastafile + m->mothurGetpid(process) + ".num.temp";
m->openOutputFile(tempFile, out);
out << num << endl;
while(!inputGroups.eof()){
if (m->control_pressed) { goodGroupOut.close(); inputGroups.close(); m->mothurRemove(goodGroupFile); return 0; }
- inputGroups >> seqName; m->gobble(inputGroups); inputGroups >> group;
+ inputGroups >> seqName; m->gobble(inputGroups); inputGroups >> group; m->gobble(inputGroups);
it = badSeqNames.find(seqName);
if(it != badSeqNames.end()){
else{
goodGroupOut << seqName << '\t' << group << endl;
}
- m->gobble(inputGroups);
}
if (m->control_pressed) { goodGroupOut.close(); inputGroups.close(); m->mothurRemove(goodGroupFile); return 0; }
//loop through and create all the processes you want
while (process != processors) {
- int pid = fork();
+ pid_t pid = fork();
if (pid > 0) {
processIDS.push_back(pid); //create map from line number to pid so you can append files in correct order later
process++;
}else if (pid == 0){
- num = driver(lines[process], goodFileName + toString(getpid()) + ".temp", badAccnos + toString(getpid()) + ".temp", filename, badSeqNames);
+ num = driver(lines[process], goodFileName + m->mothurGetpid(process) + ".temp", badAccnos + m->mothurGetpid(process) + ".temp", filename, badSeqNames);
//pass numSeqs to parent
ofstream out;
- string tempFile = filename + toString(getpid()) + ".num.temp";
+ string tempFile = filename + m->mothurGetpid(process) + ".num.temp";
m->openOutputFile(tempFile, out);
out << num << endl;
out.close();