Mapper
to_afos.c
Go to the documentation of this file.
1 #include "prototypes.h"
2 
3 int to_afos(char *fname)
4 
5 {
6 
7 char *afos,cmd[200],*p,mbuf[100];
8 time_t tim;
9 struct tm *tm;
10 int ier;
11 
12 
13 afos=getenv("AFOS");
14 
15 if(afos==NULL)
16  return(-1);
17 
18 tim=time(NULL);
19 
20 tm=gmtime(&tim);
21 
22 p=strrchr(fname,'/');
23 
24 if(p!=NULL)
25  p=p+1;
26 
27 else
28  p=fname;
29 
30 sprintf(mbuf,"%s.%02d%02d%02d.%02d%02d%02d",p,
31  tm->tm_year,
32  tm->tm_mon+1,
33  tm->tm_mday,
34  tm->tm_hour,
35  tm->tm_min,
36  tm->tm_sec);
37 
38 sprintf(cmd,"cp %s %s/%s",fname,afos,mbuf);
39 
40 printf("cmd is %s\n",cmd);
41 
42 ier=system(cmd);
43 
44 printf("ier is %d %d\n",ier);
45 
46 return(ier);
47 
48 }
49 
50 
int to_afos(char *fname)
Definition: to_afos.c:3
sprintf(fbuf,"/usr/mapper/nexrad/ngrid.%02d-%02d-%02d-%02d", year, month, day, hour)
printf("fbuf is %s\n", fbuf)
system(tarbuf)
char fname[100]
Definition: send_afos.c:6
char cmd[100]
Definition: send_afos.c:7
tim()
Definition: tim.c:4