.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Dpkg::Compression::Process 3perl" .TH Dpkg::Compression::Process 3perl 2024-03-10 1.22.6 libdpkg-perl .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Dpkg::Compression::Process \- run compression/decompression processes .SH DESCRIPTION .IX Header "DESCRIPTION" This module provides an object oriented interface to run and manage compression/decompression processes. .SH METHODS .IX Header "METHODS" .ie n .IP "$proc = Dpkg::Compression::Process\->new(%opts)" 4 .el .IP "\f(CW$proc\fR = Dpkg::Compression::Process\->new(%opts)" 4 .IX Item "$proc = Dpkg::Compression::Process->new(%opts)" Create a new instance of the object. Supported options are "compression" and "compression_level" (see corresponding set_* functions). .ie n .IP $proc\->set_compression($comp) 4 .el .IP \f(CW$proc\fR\->set_compression($comp) 4 .IX Item "$proc->set_compression($comp)" Select the compression method to use. It errors out if the method is not supported according to \fBcompression_is_supported()\fR (of Dpkg::Compression). .ie n .IP $proc\->set_compression_level($level) 4 .el .IP \f(CW$proc\fR\->set_compression_level($level) 4 .IX Item "$proc->set_compression_level($level)" Select the compression level to use. It errors out if the level is not valid according to \fBcompression_is_valid_level()\fR (of Dpkg::Compression). .ie n .IP "@exec = $proc\->\fBget_compress_cmdline()\fR" 4 .el .IP "\f(CW@exec\fR = \f(CW$proc\fR\->\fBget_compress_cmdline()\fR" 4 .IX Item "@exec = $proc->get_compress_cmdline()" .PD 0 .ie n .IP "@exec = $proc\->\fBget_uncompress_cmdline()\fR" 4 .el .IP "\f(CW@exec\fR = \f(CW$proc\fR\->\fBget_uncompress_cmdline()\fR" 4 .IX Item "@exec = $proc->get_uncompress_cmdline()" .PD Returns a list ready to be passed to \fBexec()\fR, its first element is the program name (either for compression or decompression) and the following elements are parameters for the program. .Sp When executed the program acts as a filter between its standard input and its standard output. .ie n .IP $proc\->compress(%opts) 4 .el .IP \f(CW$proc\fR\->compress(%opts) 4 .IX Item "$proc->compress(%opts)" Starts a compressor program. You must indicate where it will read its uncompressed data from and where it will write its compressed data to. This is accomplished by passing one parameter \f(CW\*(C`to_*\*(C'\fR and one parameter \&\f(CW\*(C`from_*\*(C'\fR as accepted by \fBDpkg::IPC::spawn()\fR. .Sp You must call \fBwait_end_process()\fR after having called this method to properly close the sub-process (and verify that it exited without error). .ie n .IP $proc\->uncompress(%opts) 4 .el .IP \f(CW$proc\fR\->uncompress(%opts) 4 .IX Item "$proc->uncompress(%opts)" Starts a decompressor program. You must indicate where it will read its compressed data from and where it will write its uncompressed data to. This is accomplished by passing one parameter \f(CW\*(C`to_*\*(C'\fR and one parameter \&\f(CW\*(C`from_*\*(C'\fR as accepted by \fBDpkg::IPC::spawn()\fR. .Sp You must call \fBwait_end_process()\fR after having called this method to properly close the sub-process (and verify that it exited without error). .ie n .IP $proc\->wait_end_process(%opts) 4 .el .IP \f(CW$proc\fR\->wait_end_process(%opts) 4 .IX Item "$proc->wait_end_process(%opts)" Call \fBDpkg::IPC::wait_child()\fR to wait until the sub-process has exited and verify its return code. Any given option will be forwarded to the \fBwait_child()\fR function. Most notably you can use the "nocheck" option to verify the return code yourself instead of letting \fBwait_child()\fR do it for you. .SH CHANGES .IX Header "CHANGES" .SS "Version 1.00 (dpkg 1.15.6)" .IX Subsection "Version 1.00 (dpkg 1.15.6)" Mark the module as public.