4 Compress::Zlib::FAQ -- Frequently Asked Questions about Compress::Zlib
8 Common questions answered.
10 =head2 Compatibility with Unix compress/uncompress.
12 Although C<Compress::Zlib> has a pair of functions called C<compress> and
13 C<uncompress>, they are I<not> related to the Unix programs of the same
14 name. The C<Compress::Zlib> module is not compatible with Unix
17 If you have the C<uncompress> program available, you can use this to read
20 open F, "uncompress -c $filename |";
25 Alternatively, if you have the C<gunzip> program available, you can use
26 this to read compressed files
28 open F, "gunzip -c $filename |";
33 and this to write compress files, if you have the C<compress> program
36 open F, "| compress -c $filename ";
41 =head2 Accessing .tar.Z files
43 The C<Archive::Tar> module can optionally use C<Compress::Zlib> (via the
44 C<IO::Zlib> module) to access tar files that have been compressed with
45 C<gzip>. Unfortunately tar files compressed with the Unix C<compress>
46 utility cannot be read by C<Compress::Zlib> and so cannot be directly
47 accessed by C<Archive::Tar>.
49 If the C<uncompress> or C<gunzip> programs are available, you can use one
50 of these workarounds to read C<.tar.Z> files from C<Archive::Tar>
52 Firstly with C<uncompress>
58 open F, "uncompress -c $filename |";
59 my $tar = Archive::Tar->new(*F);
62 and this with C<gunzip>
68 open F, "gunzip -c $filename |";
69 my $tar = Archive::Tar->new(*F);
72 Similarly, if the C<compress> program is available, you can use this to
73 write a C<.tar.Z> file
80 my $fh = new IO::File "| compress -c >$filename";
81 my $tar = Archive::Tar->new();
86 =head2 Accessing Zip Files
88 This module does not support reading/writing zip files.
90 Support for reading/writing zip files is included with the
91 C<IO::Compress::Zip> and C<IO::Uncompress::Unzip> modules.
93 The primary focus of the C<IO::Compress::Zip> and C<IO::Uncompress::Unzip>
94 modules is to provide an C<IO::File> compatible streaming read/write
95 interface to zip files/buffers. They are not fully flegged archivers. If
96 you are looking for an archiver check out the C<Archive::Zip> module. You
97 can find it on CPAN at
99 http://www.cpan.org/modules/by-module/Archive/Archive-Zip-*.tar.gz
103 L<Compress::Zlib>, L<IO::Compress::Gzip>, L<IO::Uncompress::Gunzip>, L<IO::Compress::Deflate>, L<IO::Uncompress::Inflate>, L<IO::Compress::RawDeflate>, L<IO::Uncompress::RawInflate>, L<IO::Compress::Bzip2>, L<IO::Uncompress::Bunzip2>, L<IO::Compress::Lzop>, L<IO::Uncompress::UnLzop>, L<IO::Compress::Lzf>, L<IO::Uncompress::UnLzf>, L<IO::Uncompress::AnyInflate>, L<IO::Uncompress::AnyUncompress>
105 L<Compress::Zlib::FAQ|Compress::Zlib::FAQ>
107 L<File::GlobMapper|File::GlobMapper>, L<Archive::Zip|Archive::Zip>,
108 L<Archive::Tar|Archive::Tar>,
113 This module was written by Paul Marquess, F<pmqs@cpan.org>.
115 =head1 MODIFICATION HISTORY
117 See the Changes file.
119 =head1 COPYRIGHT AND LICENSE
121 Copyright (c) 2005-2008 Paul Marquess. All rights reserved.
123 This program is free software; you can redistribute it and/or
124 modify it under the same terms as Perl itself.