gzfdopen man page on MirBSD

Man page or keyword search:  
man Server   6113 pages
apropos Keyword Search (all sections)
Output format
MirBSD logo
[printable version]

GZFOPEN(3)		   BSD Programmer's Manual		    GZFOPEN(3)

NAME
     gzfopen, gzfdopen - deflated stream open functions

SYNOPSIS
     #include <zlib.h>

     FILE *
     gzfopen(const char *path, const char *mode);

     FILE *
     gzfdopen(int filedes, const char *mode);

DESCRIPTION
     The gzfopen() function opens the file whose name is the string pointed to
     by path and associates a zlib stream with it.

     The gzfdopen() function associates a zlib stream with the existing file
     descriptor filedes. The mode of the stream must be compatible with the
     mode of the file descriptor. The stream is positioned at the file offset
     of the file descriptor, which must point to the first byte of the deflate
     magic in read mode. If gzfdopen() fails, the file descriptor filedes is
     not affected in any way. If gzfdopen() succeeds, any subsequential
     fclose() will also close and invalidate filedes.

     The argument mode points to a string beginning with one of the following
     characters (additional characters may follow):

     "r"     Open file for reading.

     "w"     Truncate file to zero length or create text file for writing.

     "a"     Open for writing. The file is created if it does not exist.

     The characters which can follow are the same as for the gzopen() func-
     tion:

     "b"     Binary mode (meaningless under UNIX).

     "f"     Set the zlib stream strategy to filtered.

     "h"     Set the zlib stream strategy to huffman-only.

     "R"     Set the zlib stream to use RLE compression instead of deflate.

     "0..9"  Set the compression level of the zlib stream used for writing.

RETURN VALUES
     Upon successful completion, gzfopen() and gzfdopen() return a FILE
     pointer. Otherwise, NULL is returned and the global variable errno is set
     to indicate the error.

ERRORS
     For both the gzfopen() and gzfdopen() functions, as well as stream opera-
     tions (read, write, seek, close), the code tries to meaningful map the
     zlib error codes to errno values. An unknown error is mapped to
     ENOCOFFEE.

     gzfopen() and gzfdopen() can return any error code which the underlying
     funopen() function returns, and fail for additional reasons.

SEE ALSO
     close(2), funopen(3), gzclose(3), gzdopen(3), gzopen(3), gzread(3),
     gzseek(3), gzwrite(3), lseek(2), open(2), read(2), write(2)

     The description of deflateInit2() inside compress(3).

HISTORY
     gzfopen and gzfdopen first appeared in MirOS #9.

AUTHORS
     The code and manual page have been written by Thorsten Glaser
     <tg@mirbsd.de>.

CAVEATS
     Attempt to lseek() on the stream is subject to the same limitations as
     gzseek() is, and discouraged.

MirOS BSD #10-current	       January 24, 2006				     1
[top]

List of man pages available for MirBSD

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net