/[PAMELA software]/rawreader/src/filename.cpp
ViewVC logotype

Annotation of /rawreader/src/filename.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Sun Dec 10 12:21:29 2006 UTC (17 years, 11 months ago) by cafagna
Branch: MAIN
CVS Tags: v1r12
Changes since 1.1: +6 -12 lines
*** empty log message ***

1 cafagna 1.1 /*************FILE NAME CREATION**********************************/
2     #include "descript.h"
3     #include "flag.h"
4    
5     void filename(char name1[], char name2[], char cln1[], char path [], int route, char ini_file[])
6     // name1, name2, cln1 - output parameters
7     {
8     char fno[80], temp[80], route_path[90], name_route[4];
9     char command[180]; /*DOS command*/
10     FILE *ffiot;
11    
12     name_route[0]=ini_file[5];
13     name_route[1]=ini_file[6];
14     name_route[2]=ini_file[7];
15     name_route[3]='\0';
16    
17     strcpy(temp,path);
18     strcat(temp,"tmp.dat");
19    
20     ffiot=fopen(temp, "w+");
21     fprintf(ffiot,"%03i_",route);
22     fseek(ffiot,0,0);
23     fgets(fno,10,ffiot);
24     fclose(ffiot);
25     remove(temp);
26    
27     strncat(strcpy(route_path,path),fno,3);
28 cafagna 1.2 strcat(route_path,"/tmp.dat");
29 cafagna 1.1
30     if ((ffiot=fopen(route_path,"w+"))==0)
31     /*************Create directory mmm*************************/
32     {
33 cafagna 1.2 strncat(strcat(strcat(strcat(strcpy(command,"mkdir "),path),name_route),"_"),fno,3);
34 cafagna 1.1 system(command);
35     /**********************************************************/
36    
37     /*************Create directory Cln1************************/
38 cafagna 1.2 strcat(command,"/Cln1");
39 cafagna 1.1 system(command);
40     /**********************************************************/
41     }
42 cafagna 1.2 strcat(strncat(strcat(strcat(strcpy(name1,path),name_route),"_"),fno,3),"/Cln1/");
43 cafagna 1.1 strcat(strncat(strcat(strcat(strcat(name1,name_route),"_"),fno),ini_file,5),"_cln1Er.log");
44    
45 cafagna 1.2 strcat(strncat(strcat(strcat(strcpy(name2,path),name_route),"_"),fno,3),"/Cln1/");
46 cafagna 1.1 strcat(strncat(strcat(strcat(strcat(name2,name_route),"_"),fno),ini_file,5),"_mis_cln1.dat");
47    
48 cafagna 1.2 strcat(strncat(strcat(strcat(strcpy(cln1,path),name_route),"_"),fno,3),"/Cln1/");
49 cafagna 1.1 strcat(strncat(strcat(strcat(strcat(cln1,name_route),"_"),fno),ini_file,5),"_cln1.pam");
50     if (ffiot!=0) {fclose(ffiot); remove(route_path);}
51     }

  ViewVC Help
Powered by ViewVC 1.1.23