Mapper
write_file_new.c
Go to the documentation of this file.
1 
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 int tread;
14 
15 sprintf(fname,"%s.%d.%d",prefix,num,getpid());
16 
17 fp=fopen(fname,"w");
18 
19 if(fp==NULL) {
20 
21  printf("could not open %s\n",fname);
22 
23  exit(1);
24 
25  }
26 
27 for(i=0;i<hrap_grid->maxi;i++)
28  tread=fwrite(&pcp->value[i][0],sizeof(short int),hrap_grid->maxj,fp);
29 
30 fclose(fp);
31 
32 return;
33 
34 }
35 
static int i
fclose(fp)
sprintf(fbuf,"/usr/mapper/nexrad/ngrid.%02d-%02d-%02d-%02d", year, month, day, hour)
printf("fbuf is %s\n", fbuf)
fp
Definition: make_NEXRAD.c:339
int j
Definition: mapp2h.h:48
struct hrap_grid * hrap_grid
Definition: mapper.c:142
char fname[100]
Definition: send_afos.c:6
short int maxi
Definition: misc.h:580
short int maxj
Definition: misc.h:581
Definition: misc.h:596
short int ** value
Definition: misc.h:599
void write_file(char *prefix, int num, struct pcp *pcp)
Definition: write_file_new.c:5