ZOPEN(3) BSD Library Functions Manual ZOPEN(3)NAME
zopen -- open a gzip compressed stream
LIBRARY
Compression Library (libz, -lz)
SYNOPSIS
FILE *
zopen(const char *path, const char *mode);
DESCRIPTION
The zopen() opens a gzip file whose name is the string pointed to by path and associates a stream with it. It is a wrapper around zlib(3)
and standard stream I/O APIs.
The argument mode have the same meaning as it does in fopen(3).
The zopen function will associate read, write, seek and close functions of zlib(3) after successfully opened a file with funopen(3) so that
they will be used to read or write the new stream.
RETURN VALUES
Upon successful completion zopen returns a FILE pointer. Otherwise, NULL is returned and the global variable errno is set to indicate the
error.
ERRORS
In addition to the errors documented for fopen(3), the zopen function may also fail for:
[ENOMEM] Insufficient memory is available.
COMPATIBILITY
This implementation of zopen function first appeared in NetBSD 1.6 and FreeBSD 4.5. The zopen function may not be portable to systems other
than FreeBSD.
SEE ALSO fopen(3), funopen(3), zlib(3)BSD March 5, 2014 BSD
Check Out this Related Man Page
ZOPEN(3) BSD Library Functions Manual ZOPEN(3)NAME
zopen -- compressed stream open function
SYNOPSIS
#include "zopen.h"
FILE *
zopen(const char *path, const char *mode, int bits);
DESCRIPTION
The zopen() function opens the compressed file whose name is the string pointed to by path and associates a stream with it.
The argument mode points to one of the following one-character strings:
``r'' Open compressed file for reading. The stream is positioned at the beginning of the file.
``w'' Truncate file to zero length or create compressed file for writing. The stream is positioned at the beginning of the file.
Any created files will have mode "S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH" (0666), as modified by the process' umask value
(see umask(2)).
Files may only be read or written. Seek operations are not allowed.
The bits argument, if non-zero, is set to the bits code limit. If zero, the default is 16. See compress(1) for more information.
RETURN VALUES
Upon successful completion zopen() returns a FILE pointer. Otherwise, NULL is returned and the global variable errno is set to indicate the
error.
ERRORS
[EINVAL] The mode or bits arguments specified to zopen() were invalid.
[EFTYPE] The compressed file starts with an invalid header, or the compressed file is compressed with more bits than can be handled.
The zopen() function may also fail and set errno for any of the errors specified for the routines fopen(3) or funopen(3).
SEE ALSO compress(1), fopen(3), funopen(3)HISTORY
The zopen function first appeared in 4.4BSD.
BUGS
The zopen() function may not be portable to systems other than BSD.
BSD June 9, 1993 BSD
The open() system call directly returns a fdes, whereas it's more portable 'ANSI C' counterpart fopen() returns a pointer the the FILE struct.
I have seen implementation of stdio.h on HP-UX, BSD and a few more, the typedef'd struct FILE stores the value of file descriptor in differenrt ways... (1 Reply)
I'm in the Solaris environment. I want to write data to a file, but I don't want it to be easily read from the C shell. For example, here's my code:
main ()
{
FILE *fo;
fo = fopen ("filename", "w");
fprintf (fo, "This is a test.\n");
fclose (fo);
}
Anyone can open up... (3 Replies)
Is there a port or shorthand way of installing the zlib library on FreeBSD? I currently use the following:
wget http://zlib.net/zlib-1.2.5.tar.gz
tar zxf zlib*.gz
cd zlib*\.
./configure --libdir=/usr/lib --includedir=/usr/include
make install clean
This is somewhat contrived code and for a... (4 Replies)
Library path variables.
I need to know the library rnvironment variable in linux. Ie, I install zlib directory in the custom path /usr/local/mylib and give --enable-zlib in the ffmpeg install, ffmpeg should check for the zlib libraries in the path /usr/local/mylib. Currently it checks /usr/lib... (5 Replies)
I am trying to configure gpac. I get the error as follows.
# ./configure
error: zlib not found on system or in local libs
I have installed zlib on custom path /usr/local/myapps. I know the above error occurs when devel package or .h file is not present. Its present on the server.
# ll... (7 Replies)
Hello,
I have a problem here, I want to write a function called"myfopen()" instead of "fopen()"
for writing this function I must not use the <stdio.h> library,
Can you help me?
thanks a lot (2 Replies)