NAME

IPC::PrettyPipe::Stream - An I/O stream for an IPC::PrettyPipe pipeline or command

VERSION

version 0.12

SYNOPSIS

  use IPC::PrettyPipe::Stream;

  # standard constructor
  $stream = IPC::PrettyPipe::Stream->new( spec => $spec, %attr );
  $stream = IPC::PrettyPipe::Stream->new( spec => $spec, file => $file, %attr );

  # concise constructors
  $stream = IPC::PrettyPipe::Stream->new( $spec );
  $stream = IPC::PrettyPipe::Stream->new( [ $spec, $file ] );

DESCRIPTION

IPC::PrettyPipe::Stream objects represent I/O streams attached to either IPC::PrettyPipe or IPC::PrettyPipe::Cmd objects.

METHODS

new
  # named parameters; may provide additional attributes
  $stream = IPC::PrettyPipe::Stream->new( spec => $spec, file => $file, %attr );
  $stream = IPC::PrettyPipe::Stream->new( \%attr );

  # concise interface
  $stream = IPC::PrettyPipe::Stream->new( $spec );
  $stream = IPC::PrettyPipe::Stream->new( [ $spec, $file ] );

The available attributes are:

spec

A stream specification. See IPC::PrettyPipe::Stream::Utils for more information.

file

The optional file attached to the stream. A file is not needed if the specification is for a redirection or a close.

strict

If true, die if the stream specification requires a file but one is not provided, or it does not require a file and one is provided.

spec
  $spec = $stream->spec;

Retrieve the specification passed in to the constructor.

file
  $file = $stream->file;

Return the file passed in to the constructor (if one was).

quoted_file
  $file = $stream->quoted_file;

Return the file passed in to the constructor (if one was), appropriately quoted for passing as a single word to a Bourne compatible shell.

has_file
  $bool = $stream->has_file;

Returns true if a file was passed to the constructor.

requires_file
  $bool = $stream->requires_file;

Returns true if the stream specification requires a file.

Op
N
M
  $Op = $stream->Op;
  $N  = $stream->N;
  $M  = $stream->M;

Retrieve the components of the specification.

has_N
has_M
  $bool = $stream->has_N;
  $bool = $stream->has_M;

Return true if the stream specification contained the associated component.

apply
  ( $sub, @fh ) = $stream->apply;

Returns a subroutine which will implement the stream operations and and a list of filehandles or descriptors which would be affected. This routine is used by backend wrappers in conjunction with IO::ReStoreFH to handle pipe level stream operations (rather than command stream operations, which are done by the actual backend modules).

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=IPC-PrettyPipe or by email to bug-IPC-PrettyPipe@rt.cpan.org.

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

SOURCE

The development version is on github at https://github.com/djerius/ipc-prettypipe and may be cloned from git://github.com/djerius/ipc-prettypipe.git

SEE ALSO

Please see those modules/websites for more information related to this module.

AUTHOR

Diab Jerius <djerius@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2018 by Smithsonian Astrophysical Observatory.

This is free software, licensed under:

  The GNU General Public License, Version 3, June 2007