--- rawreader/src/filename.cpp 2006/12/10 12:21:29 1.2 +++ rawreader/src/filename.cpp 2006/12/10 12:52:50 1.3 @@ -5,7 +5,7 @@ void filename(char name1[], char name2[], char cln1[], char path [], int route, char ini_file[]) // name1, name2, cln1 - output parameters { - char fno[80], temp[80], route_path[90], name_route[4]; + char fno[80], route_path[90], name_route[4]; char command[180]; /*DOS command*/ FILE *ffiot; @@ -13,16 +13,9 @@ name_route[1]=ini_file[6]; name_route[2]=ini_file[7]; name_route[3]='\0'; - - strcpy(temp,path); - strcat(temp,"tmp.dat"); - ffiot=fopen(temp, "w+"); - fprintf(ffiot,"%03i_",route); - fseek(ffiot,0,0); - fgets(fno,10,ffiot); - fclose(ffiot); - remove(temp); + sprintf(command,"%03i_",route); + sscanf(command,"%s",fno); strncat(strcpy(route_path,path),fno,3); strcat(route_path,"/tmp.dat"); @@ -40,12 +33,12 @@ /**********************************************************/ } strcat(strncat(strcat(strcat(strcpy(name1,path),name_route),"_"),fno,3),"/Cln1/"); - strcat(strncat(strcat(strcat(strcat(name1,name_route),"_"),fno),ini_file,5),"_cln1Er.log"); + strcat(strcat(strcat(strcat(strcat(strncat(name1,ini_file,5),"_"),name_route),"_"),fno),"cln1Er.log"); strcat(strncat(strcat(strcat(strcpy(name2,path),name_route),"_"),fno,3),"/Cln1/"); - strcat(strncat(strcat(strcat(strcat(name2,name_route),"_"),fno),ini_file,5),"_mis_cln1.dat"); + strcat(strcat(strcat(strcat(strcat(strncat(name2,ini_file,5),"_"),name_route),"_"),fno),"mis_cln1.dat"); strcat(strncat(strcat(strcat(strcpy(cln1,path),name_route),"_"),fno,3),"/Cln1/"); - strcat(strncat(strcat(strcat(strcat(cln1,name_route),"_"),fno),ini_file,5),"_cln1.pam"); + strcat(strcat(strcat(strcat(strcat(strncat(cln1,ini_file,5),"_"),name_route),"_"),fno),"cln1.pam"); if (ffiot!=0) {fclose(ffiot); remove(route_path);} }