Mapper
libraries
common
write_file.c
Go to the documentation of this file.
1
#define _POSIX_SOURCE
2
#include "
prototypes_new.h
"
3
4
5
void
write_file
(
char
*prefix,
int
num,
struct
pcp
*
pcp
)
6
7
{
8
9
FILE *
fp
;
10
char
fname
[100];
11
extern
struct
hrap_grid
*
hrap_grid
;
12
int
i
,
j
;
13
14
sprintf
(
fname
,
"%s.%d"
,prefix,num);
15
16
fp
=fopen(
fname
,
"w"
);
17
18
if
(
fp
==NULL) {
19
20
printf
(
"could not open %s\n"
,
fname
);
21
22
exit(1);
23
24
}
25
26
fwrite(&
pcp
->
value
[0][0],
sizeof
(
short
int
),
hrap_grid
->
maxi
*
hrap_grid
->
maxj
,
fp
);
27
28
fclose
(
fp
);
29
30
chmod(
fname
,S_IRUSR | S_IWUSR |
31
S_IRGRP | S_IWGRP |
32
S_IROTH | S_IWOTH);
33
34
return
;
35
36
}
37
i
static int i
Definition:
get_apps_defaults.c:110
write_file
void write_file(char *prefix, int num, struct pcp *pcp)
Definition:
write_file.c:5
fclose
fclose(fp)
sprintf
sprintf(fbuf,"/usr/mapper/nexrad/ngrid.%02d-%02d-%02d-%02d", year, month, day, hour)
printf
printf("fbuf is %s\n", fbuf)
fp
fp
Definition:
make_NEXRAD.c:339
j
int j
Definition:
mapp2h.h:48
hrap_grid
struct hrap_grid * hrap_grid
Definition:
mapper.c:142
prototypes_new.h
fname
char fname[100]
Definition:
send_afos.c:6
hrap_grid
Definition:
misc.h:578
hrap_grid::maxi
short int maxi
Definition:
misc.h:580
hrap_grid::maxj
short int maxj
Definition:
misc.h:581
pcp
Definition:
misc.h:596
pcp::value
short int ** value
Definition:
misc.h:599
Generated by
1.9.1