5 |
void filename(char name1[], char name2[], char cln1[], char path [], int route, char ini_file[]) |
void filename(char name1[], char name2[], char cln1[], char path [], int route, char ini_file[]) |
6 |
// name1, name2, cln1 - output parameters |
// name1, name2, cln1 - output parameters |
7 |
{ |
{ |
8 |
char fno[80], temp[80], route_path[90], name_route[4]; |
char fno[80], route_path[90], name_route[4]; |
9 |
char command[180]; /*DOS command*/ |
char command[180]; /*DOS command*/ |
10 |
FILE *ffiot; |
FILE *ffiot; |
11 |
|
|
13 |
name_route[1]=ini_file[6]; |
name_route[1]=ini_file[6]; |
14 |
name_route[2]=ini_file[7]; |
name_route[2]=ini_file[7]; |
15 |
name_route[3]='\0'; |
name_route[3]='\0'; |
|
|
|
|
strcpy(temp,path); |
|
|
strcat(temp,"tmp.dat"); |
|
16 |
|
|
17 |
ffiot=fopen(temp, "w+"); |
sprintf(command,"%03i_",route); |
18 |
fprintf(ffiot,"%03i_",route); |
sscanf(command,"%s",fno); |
|
fseek(ffiot,0,0); |
|
|
fgets(fno,10,ffiot); |
|
|
fclose(ffiot); |
|
|
remove(temp); |
|
19 |
|
|
20 |
strncat(strcpy(route_path,path),fno,3); |
strncat(strcpy(route_path,path),fno,3); |
21 |
strcat(route_path,"/tmp.dat"); |
strcat(route_path,"/tmp.dat"); |
33 |
/**********************************************************/ |
/**********************************************************/ |
34 |
} |
} |
35 |
strcat(strncat(strcat(strcat(strcpy(name1,path),name_route),"_"),fno,3),"/Cln1/"); |
strcat(strncat(strcat(strcat(strcpy(name1,path),name_route),"_"),fno,3),"/Cln1/"); |
36 |
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"); |
37 |
|
|
38 |
strcat(strncat(strcat(strcat(strcpy(name2,path),name_route),"_"),fno,3),"/Cln1/"); |
strcat(strncat(strcat(strcat(strcpy(name2,path),name_route),"_"),fno,3),"/Cln1/"); |
39 |
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"); |
40 |
|
|
41 |
strcat(strncat(strcat(strcat(strcpy(cln1,path),name_route),"_"),fno,3),"/Cln1/"); |
strcat(strncat(strcat(strcat(strcpy(cln1,path),name_route),"_"),fno,3),"/Cln1/"); |
42 |
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"); |
43 |
if (ffiot!=0) {fclose(ffiot); remove(route_path);} |
if (ffiot!=0) {fclose(ffiot); remove(route_path);} |
44 |
} |
} |