Lines Matching defs:file

1 /* gzappend -- command to append to a gzip file
36 * - Simplfy and unify file operations
37 * - Finish off gzip file in gztack()
39 * - Keep gzip file clean on appended file read errors
45 gzappend takes a gzip file and appends to it, compressing files from the
46 command line or data from stdin. The gzip file is written to directly, to
47 avoid copying that file, in case it's large. Note that this results in the
48 unfriendly behavior that if gzappend fails, the gzip file is corrupted.
58 gzappend first decompresses the gzip file internally, discarding all but
64 Then the last block bit is cleared by seeking back in the file and rewriting
69 data from the gzip file to initialize the dictionary. If the total
73 append is simply compressed using deflate, and written to the gzip file.
75 as the trailer of the gzip file.
167 /* structure for gzip file read operations */
169 int fd; /* file descriptor */
174 char *name; /* file name for error messages */
175 } file;
178 local int readin(file *in)
189 /* read from file in, exit if end-of-file */
190 local int readmore(file *in)
200 local void skip(file *in, unsigned n)
221 unsigned long read4(file *in)
233 local void gzheader(file *in)
238 if (read1(in) != 31 || read1(in) != 139) bye(in->name, " not a gzip file");
253 /* decompress gzip file "name", return strm with a deflate stream ready to
254 continue compression of the data in the gzip file, and return a file
264 file gz;
266 /* open gzip file */
347 /* if not at end of file, warn */
350 "gzappend warning: junk at end of gzip file overwritten\n");
384 /* append file "name" to gzip file gd using deflate stream strm -- if last
392 /* open file to compress and append */
406 /* compress input file and append to gzip file */
428 if (len == -1) bye("writing gzip file", "");
448 if (ret == -1) bye("writing gzip file", "");
460 /* process the compression level option if present, scan the gzip file, and
461 append the specified files, or append the data from stdin if no other file
462 names are provided on the command line -- the gzip file must be writable
476 "usage: gzappend [-level] file.gz [ addthis [ andthis ... ]]\n");
486 if (*++argv == NULL) bye("no gzip file name after options", "");
489 /* prepare to append to gzip file */