Lines Matching defs:mode
134 char mode; // w, a, or r
3002 static struct zfile *new_file(char *fn, FILE *fp, char mode, char file_or_pipe)
3005 *f = (struct zfile){TT.zfiles, xstrdup(fn), fp, mode, file_or_pipe,
3056 // FIXME TODO check if file/pipe/mode matches what's in the table already.
3057 // Apparently gawk/mawk/nawk are OK with different mode, but just use the file
3058 // in whatever mode it's already in; i.e. > after >> still appends.
3059 static struct zfile *setup_file(char file_or_pipe, char *mode)
3069 FILE *fp = (file_or_pipe ? fopen : popen)(fn, mode);
3071 struct zfile *p = new_file(fn, fp, *mode, file_or_pipe);
3075 if (*mode != 'r') FFATAL("cannot open '%s'\n", fn);