Mapper
libraries
common
to_wan.c
Go to the documentation of this file.
1
#include "
prototypes_new.h
"
2
/* adapted to send products to wan q */
3
int
to_wan
(
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\n"
,ier);
45
46
return
(ier);
47
48
}
49
50
sprintf
sprintf(fbuf,"/usr/mapper/nexrad/ngrid.%02d-%02d-%02d-%02d", year, month, day, hour)
printf
printf("fbuf is %s\n", fbuf)
system
system(tarbuf)
prototypes_new.h
fname
char fname[100]
Definition:
send_afos.c:6
cmd
char cmd[100]
Definition:
send_afos.c:7
tim
tim()
Definition:
tim.c:4
to_wan
int to_wan(char *fname)
Definition:
to_wan.c:3
Generated by
1.9.1