Dpkg::IPC - helper functions for IPC
Dpkg::IPC offers helper functions to allow you to execute other programs in an easy, yet flexible way, while hiding all the gory details of IPC (Inter-Process Communication) from you.
Creates a child process and executes another program in it. The arguments are interpreted as a hash of options, specifying how to handle the in and output of the program to execute. Returns the pid of the child process (unless the wait_child option was given).
Any error will cause the function to exit with one of the Dpkg::ErrorHandling functions.
Options:
Can be either a scalar, i.e. the name of the program to be executed, or an array reference, i.e. the name of the program plus additional arguments. Note that the program will never be executed via the shell, so you can't specify additional arguments in the scalar string and you can't use any shell facilities like globbing.
Mandatory Option.
to_pipe
and error_to_pipe
) or the writing
end (from_pipe
) will be returned in the referenced scalar. Standard
input/output/error of the child process will be dup'ed to the other ends
of the pipes.
from_string
, as the string is not modified in any way. This was
chosen only for reasons of symmetry with to_string
and
error_to_string
. to_string
and error_to_string
imply the
wait_child
option.
Takes as first argument the pid of the process to wait for. Remaining arguments are taken as a hash of options. Returns nothing. Fails if the child has been ended by a signal or if it exited non-zero.
Options:
Written by Raphaël Hertzog <hertzog@debian.org> and Frank Lichtenheld <djpig@debian.org>.
Dpkg, Dpkg::ErrorHandling