Move Compress::Raw::Zlib from ext/ to cpan/
[p5sagit/p5-mst-13.2.git] / cpan / Compress-Raw-Zlib / pod / FAQ.pod
CommitLineData
d54256af 1
2=head1 NAME
3
4Compress::Raw::Zlib::FAQ -- Frequently Asked Questions about Compress::Raw::Zlib
5
6=head1 DESCRIPTION
7
8Common questions answered.
9
10=head2 Compatibility with Unix compress/uncompress.
11
12This module is not compatible with Unix C<compress>.
13
14If you have the C<uncompress> program available, you can use this to read
15compressed files
16
17 open F, "uncompress -c $filename |";
18 while (<F>)
19 {
20 ...
21
22Alternatively, if you have the C<gunzip> program available, you can use
23this to read compressed files
24
25 open F, "gunzip -c $filename |";
26 while (<F>)
27 {
28 ...
29
30and this to write compress files, if you have the C<compress> program
31available
32
33 open F, "| compress -c $filename ";
34 print F "data";
35 ...
36 close F ;
37
38=head2 Accessing .tar.Z files
39
40See previous FAQ item.
41
42If the C<Archive::Tar> module is installed and either the C<uncompress> or
43C<gunzip> programs are available, you can use one of these workarounds to
44read C<.tar.Z> files.
45
46Firstly with C<uncompress>
47
48 use strict;
49 use warnings;
50 use Archive::Tar;
51
52 open F, "uncompress -c $filename |";
53 my $tar = Archive::Tar->new(*F);
54 ...
55
56and this with C<gunzip>
57
58 use strict;
59 use warnings;
60 use Archive::Tar;
61
62 open F, "gunzip -c $filename |";
63 my $tar = Archive::Tar->new(*F);
64 ...
65
66Similarly, if the C<compress> program is available, you can use this to
67write a C<.tar.Z> file
68
69 use strict;
70 use warnings;
71 use Archive::Tar;
72 use IO::File;
73
74 my $fh = new IO::File "| compress -c >$filename";
75 my $tar = Archive::Tar->new();
76 ...
77 $tar->write($fh);
78 $fh->close ;
79
80=head2 Accessing Zip Files
81
82This module does not support reading/writing zip files.
83
84Support for reading/writing zip files is included with the
85C<IO::Compress::Zip> and C<IO::Uncompress::Unzip> modules.
86
87The primary focus of the C<IO::Compress::Zip> and C<IO::Uncompress::Unzip>
88modules is to provide an C<IO::File> compatible streaming read/write
89interface to zip files/buffers. They are not fully flegged archivers. If
90you are looking for an archiver check out the C<Archive::Zip> module. You
91can find it on CPAN at
92
93 http://www.cpan.org/modules/by-module/Archive/Archive-Zip-*.tar.gz
94
95=head2 Zlib Library Version Support
96
97By default C<Compress::Raw::Zlib> will build with a private copy of version
981.2.3 of the zlib library. (See the F<README> file for details of
99how to override this behaviour)
100
101If you decide to use a different version of the zlib library, you need to be
102aware of the following issues
103
104=over 5
105
106=item *
107
108First off, you must have zlib 1.0.5 or better.
109
110=item *
111
112You need to have zlib 1.2.1 or better if you want to use the C<-Merge>
113option with C<IO::Compress::Gzip>, C<IO::Compress::Deflate> and
114C<IO::Compress::RawDeflate>.
115
116=back
117
118=head1 SEE ALSO
119
120L<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>
121
122L<Compress::Zlib::FAQ|Compress::Zlib::FAQ>
123
124L<File::GlobMapper|File::GlobMapper>, L<Archive::Zip|Archive::Zip>,
125L<Archive::Tar|Archive::Tar>,
126L<IO::Zlib|IO::Zlib>
127
128=head1 AUTHOR
129
130This module was written by Paul Marquess, F<pmqs@cpan.org>.
131
132=head1 MODIFICATION HISTORY
133
134See the Changes file.
135
136=head1 COPYRIGHT AND LICENSE
137
319fab50 138Copyright (c) 2005-2009 Paul Marquess. All rights reserved.
d54256af 139
140This program is free software; you can redistribute it and/or
141modify it under the same terms as Perl itself.
142