if (infile == NULL) {
save_fd = dup(0);
- fp = fdopen(save_fd, "r");
+ fp = fdopen(save_fd, "rb");
} else {
- fp = fopen(infile, "r");
+ fp = fopen(infile, "rb");
}
fp = uncompress_pipe(fp);
n = 0;
FILE *fp;\r
char magic[11];\r
\r
- if ((fp = fopen(infile, "r")) == NULL) {\r
+ if ((fp = fopen(infile, "rb")) == NULL) {\r
perror(infile);\r
return UNKNOWN;\r
}\r
if (infile == NULL) {
int save_fd;
save_fd = dup(0);
- fp = fdopen(save_fd, "r");
+ fp = fdopen(save_fd, "rb");
} else
- if((fp=fopen(infile, "r"))==(FILE *)NULL) {
+ if((fp=fopen(infile, "rb"))==(FILE *)NULL) {
perror(infile);
return radar;
}
return NULL;
}
- fpipe = popen("gzip -q -d -f --stdout", "r");
+ fpipe = popen("gzip -q -d -f --stdout", "rb");
if (fpipe == NULL) perror("uncompress_pipe");
close(0);
if (dup(save_fd) < 0) {
return NULL;
}
- fpipe = popen("gzip -q -1 -c", "w");
+ fpipe = popen("gzip -q -1 -c", "wb");
if (fpipe == NULL) perror("compress_pipe");
close(1);
if (dup(save_fd) < 0) {
}
if (radar_verbose_flag) fprintf(stderr,"print_histogram: %s\n",filename);
- if((fp = fopen(filename,"w")) == NULL ) {
+ if((fp = fopen(filename,"wb")) == NULL ) {
perror(filename);
return;
}
int nbins;
Histogram *histogram;
- if ((fp = fopen(infile, "r")) == NULL) {
+ if ((fp = fopen(infile, "rb")) == NULL) {
perror(infile);
return NULL;
}
FILE *fp;
int n;
- if ((fp = fopen(outfile, "w")) == NULL) {
+ if ((fp = fopen(outfile, "wb")) == NULL) {
perror(outfile);
return -1;
}
{
FILE *fp;
- fp = fopen(infile, "r");
+ fp = fopen(infile, "rb");
if (fp == NULL) {
perror(infile);
exit(-1);
FILE *fp;
if (s == NULL) return;
- fp = fopen(outfile,"w");
+ fp = fopen(outfile,"wb");
if (fp == NULL) {
perror(outfile);
return;
fpipe = NULL;
nbytes = xdim*ydim;
(void)sprintf(pipecmd, "ppmtogif > %s 2>/dev/null", outfile);
- fpipe = popen(pipecmd, "w"); /* Global FILE * */
+ fpipe = popen(pipecmd, "wb"); /* Global FILE * */
if (fpipe == NULL) {
perror("RSL_write_gif1");
return;
}
nbytes = xdim*ydim;
(void)sprintf(pipecmd, "ppmtopict > %s 2>/dev/null", outfile);
- fpipe = popen(pipecmd, "w"); /* Global FILE * */
+ fpipe = popen(pipecmd, "wb"); /* Global FILE * */
fprintf(fpipe, "P6\n# %s\n%d %d\n255\n",outfile, xdim, ydim);
for (i=0; i<nbytes; i++)
if (fwrite(c_table[image[i]], sizeof(char), 3, fpipe) != 3)
return;
}
nbytes = xdim*ydim;
- fpipe = fopen(outfile, "w"); /* Global FILE * */
+ fpipe = fopen(outfile, "wb"); /* Global FILE * */
fprintf(fpipe, "P6\n# %s\n%d %d\n255\n",outfile, xdim, ydim);
for (i=0; i<nbytes; i++)
if (fwrite(c_table[image[i]], sizeof(char), 3, fpipe) != 3)
}
nbytes = xdim*ydim;
(void)sprintf(pipecmd, "gzip > %s.gz 2>/dev/null", outfile);
- fpipe = popen(pipecmd, "w"); /* Global FILE * */
+ fpipe = popen(pipecmd, "wb"); /* Global FILE * */
fprintf(fpipe, "P5\n# %s\n%d %d\n255\n",outfile, xdim, ydim);
if (fwrite(image, sizeof(char), nbytes, fpipe) != nbytes)
fprintf(stderr, "RSL_write_pgm: short write\n");
/* The following is commented and is for non compressed. */
#ifdef COMPILE
nbytes = xdim*ydim;
- fpipe = fopen(outfile, "w"); /* Global FILE * */
+ fpipe = fopen(outfile, "wb"); /* Global FILE * */
fprintf(fpipe, "P5\n# %s\n%d %d\n255\n",outfile, xdim, ydim);
(void)fwrite(image, sizeof(char), nbytes, fpipe);
(void)fclose(fpipe);
if (infile == NULL) {
int save_fd;
save_fd = dup(0);
- f = fdopen(save_fd, "r");
+ f = fdopen(save_fd, "rb");
} else
- if((f=fopen(infile, "r"))==(FILE *)NULL) {
+ if((f=fopen(infile, "rb"))==(FILE *)NULL) {
perror(infile);
return NULL;
}
}
/* Open Mcgill data file for reading */
- if ((file->fp = fopen(filename, "r")) == NULL)
+ if ((file->fp = fopen(filename, "rb")) == NULL)
{
*code = MCG_OPEN_FILE_ERR;
return(NULL);
/* Open input file */
if (file_name == NULL) { /* Use stdin */
save_fd = dup(0);
- fp = fdopen(save_fd, "r");
- } else if((fp = fopen(file_name,"r")) == NULL) {
+ fp = fdopen(save_fd, "rb");
+ } else if((fp = fopen(file_name,"rb")) == NULL) {
perror(file_name);
return fp;
}
return;
}
- if ((fp = fopen(outfile, "w")) == NULL) {
+ if ((fp = fopen(outfile, "wb")) == NULL) {
perror(outfile);
return;
}
return;
}
- if ((fp = fopen(outfile, "w")) == NULL) {
+ if ((fp = fopen(outfile, "wb")) == NULL) {
perror(outfile);
return;
}
if (infile == NULL) {
fp = stdin;
} else {
- if((fp = fopen(infile, "r")) == NULL) {
+ if((fp = fopen(infile, "rb")) == NULL) {
perror(infile);
return NULL;
}
if (infile == NULL) {
int save_fd;
save_fd = dup(0);
- fp = fdopen(save_fd, "r");
+ fp = fdopen(save_fd, "rb");
}
- else if ((fp = fopen(infile, "r")) == NULL) {
+ else if ((fp = fopen(infile, "rb")) == NULL) {
perror(infile);
return NULL;
}
radar = NULL;
if (infile == NULL) {
save_fd = dup(0);
- fp = fdopen(save_fd, "r");
+ fp = fdopen(save_fd, "rb");
} else {
- if ((fp = fopen(infile, "r")) == NULL) {
+ if ((fp = fopen(infile, "rb")) == NULL) {
perror(infile);
return radar;
}
int nradar;
char title[100];
- if ((fp = fopen(infile, "r")) == NULL) {
+ if ((fp = fopen(infile, "rb")) == NULL) {
perror(infile);
return NULL;
}
if (radar == NULL) return 0;
- if ((fp = fopen(outfile, "w")) == NULL) {
+ if ((fp = fopen(outfile, "wb")) == NULL) {
perror(outfile);
return -1;
}
int n;
if (radar == NULL) return 0;
- if ((fp = fopen(outfile, "w")) == NULL) {
+ if ((fp = fopen(outfile, "wb")) == NULL) {
perror(outfile);
return -1;
}
/* Unfortunately, there is no tg_close to modularize the following
* pipe close. Shouldn't be any problems anyway.
*/
- (void) uncompress_pipe(fdopen(tg_file->fd, "r")); /* Redirect through gunzip. */
+ (void) uncompress_pipe(fdopen(tg_file->fd, "rb")); /* Redirect through gunzip. */
/* initialize buffer pointers, flags */
tg_file->buf_ind = 32769;
tg_file->buf_end = 32769;
if (infile == NULL) {
int save_fd;
save_fd = dup(0);
- fp = fdopen(save_fd, "r");
- } else if ((fp = fopen(infile, "r")) == NULL) {
+ fp = fdopen(save_fd, "rb");
+ } else if ((fp = fopen(infile, "rb")) == NULL) {
perror(infile);
return radar;
}
if ( strcmp(filename, "stdin") == 0 ) {
save_fd = dup(0);
- wf->fptr = fdopen(save_fd,"r");
+ wf->fptr = fdopen(save_fd,"rb");
} else {
- wf->fptr = fopen(filename, "r");
+ wf->fptr = fopen(filename, "rb");
}
if (wf->fptr == NULL) return NULL;
int n;
char c;
- if ((fp = fopen(first_file, "r")) == NULL) {
+ if ((fp = fopen(first_file, "rb")) == NULL) {
perror(first_file);
return 0;
}
struct radar_site *currsite=NULL;
FILE *in_file;
- if((in_file=fopen(WSR88D_SITE_INFO_FILE, "r")) !=NULL)
+ if((in_file=fopen(WSR88D_SITE_INFO_FILE, "rb")) !=NULL)
{
/* read each line */
while (fgets(line,sizeof(line),in_file) != NULL)