{
    "content": [
        {
            "type": "text",
            "text": "# IPC::Run::IO (perldoc)\n\n## NAME\n\nIPC::Run::IO -- I/O channels for IPC::Run.\n\n## SYNOPSIS\n\nNOT IMPLEMENTED YET ON Win32! Win32 does not allow select() on normal file descriptors;\nIPC::RUN::IO needs to use IPC::Run::Win32Helper to do this.\nuse IPC::Run qw( io );\n## The sense of '>' and '<' is opposite of perl's open(),\n## but agrees with IPC::Run.\n$io = io( \"filename\", '>',  \\$recv );\n$io = io( \"filename\", 'r',  \\$recv );\n## Append to $recv:\n$io = io( \"filename\", '>>', \\$recv );\n$io = io( \"filename\", 'ra', \\$recv );\n$io = io( \"filename\", '<',  \\$send );\n$io = io( \"filename\", 'w',  \\$send );\n$io = io( \"filename\", '<<', \\$send );\n$io = io( \"filename\", 'wa', \\$send );\n## Handles / IO objects that the caller opens:\n$io = io( \\*HANDLE,   '<',  \\$send );\n$f = IO::Handle->new( ... ); # Any subclass of IO::Handle\n$io = io( $f, '<', \\$send );\nrequire IPC::Run::IO;\n$io = IPC::Run::IO->new( ... );\n## Then run(), harness(), or start():\nrun $io, ...;\n## You can, of course, use io() or IPC::Run::IO->new() as an\n## argument to run(), harness, or start():\nrun io( ... );\n\n## DESCRIPTION\n\nThis class and module allows filehandles and filenames to be harnessed for I/O when used\nIPC::Run, independent of anything else IPC::Run is doing (except that errors & exceptions can\naffect all things that IPC::Run is doing).\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **SUBCLASSING**\n- **SUBROUTINES**\n- **AUTHOR**\n- **TODO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "IPC::Run::IO",
        "section": "",
        "mode": "perldoc",
        "summary": "IPC::Run::IO -- I/O channels for IPC::Run.",
        "synopsis": "NOT IMPLEMENTED YET ON Win32! Win32 does not allow select() on normal file descriptors;\nIPC::RUN::IO needs to use IPC::Run::Win32Helper to do this.\nuse IPC::Run qw( io );\n## The sense of '>' and '<' is opposite of perl's open(),\n## but agrees with IPC::Run.\n$io = io( \"filename\", '>',  \\$recv );\n$io = io( \"filename\", 'r',  \\$recv );\n## Append to $recv:\n$io = io( \"filename\", '>>', \\$recv );\n$io = io( \"filename\", 'ra', \\$recv );\n$io = io( \"filename\", '<',  \\$send );\n$io = io( \"filename\", 'w',  \\$send );\n$io = io( \"filename\", '<<', \\$send );\n$io = io( \"filename\", 'wa', \\$send );\n## Handles / IO objects that the caller opens:\n$io = io( \\*HANDLE,   '<',  \\$send );\n$f = IO::Handle->new( ... ); # Any subclass of IO::Handle\n$io = io( $f, '<', \\$send );\nrequire IPC::Run::IO;\n$io = IPC::Run::IO->new( ... );\n## Then run(), harness(), or start():\nrun $io, ...;\n## You can, of course, use io() or IPC::Run::IO->new() as an\n## argument to run(), harness, or start():\nrun io( ... );",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 36,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "SUBCLASSING",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SUBROUTINES",
                "lines": 55,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "TODO",
                "lines": 2,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "IPC::Run::IO -- I/O channels for IPC::Run.\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "NOT IMPLEMENTED YET ON Win32! Win32 does not allow select() on normal file descriptors;\nIPC::RUN::IO needs to use IPC::Run::Win32Helper to do this.\n\nuse IPC::Run qw( io );\n\n## The sense of '>' and '<' is opposite of perl's open(),\n## but agrees with IPC::Run.\n$io = io( \"filename\", '>',  \\$recv );\n$io = io( \"filename\", 'r',  \\$recv );\n\n## Append to $recv:\n$io = io( \"filename\", '>>', \\$recv );\n$io = io( \"filename\", 'ra', \\$recv );\n\n$io = io( \"filename\", '<',  \\$send );\n$io = io( \"filename\", 'w',  \\$send );\n\n$io = io( \"filename\", '<<', \\$send );\n$io = io( \"filename\", 'wa', \\$send );\n\n## Handles / IO objects that the caller opens:\n$io = io( \\*HANDLE,   '<',  \\$send );\n\n$f = IO::Handle->new( ... ); # Any subclass of IO::Handle\n$io = io( $f, '<', \\$send );\n\nrequire IPC::Run::IO;\n$io = IPC::Run::IO->new( ... );\n\n## Then run(), harness(), or start():\nrun $io, ...;\n\n## You can, of course, use io() or IPC::Run::IO->new() as an\n## argument to run(), harness, or start():\nrun io( ... );\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This class and module allows filehandles and filenames to be harnessed for I/O when used\nIPC::Run, independent of anything else IPC::Run is doing (except that errors & exceptions can\naffect all things that IPC::Run is doing).\n",
                "subsections": []
            },
            "SUBCLASSING": {
                "content": "INCOMPATIBLE CHANGE: due to the awkwardness introduced in ripping pseudohashes out of Perl, this\nclass *no longer* uses the fields pragma.\n",
                "subsections": []
            },
            "SUBROUTINES": {
                "content": "new I think it takes >> or << along with some other data.\n\nTODO: Needs more thorough documentation. Patches welcome.\n\nfilename\nGets/sets the filename. Returns the value after the name change, if any.\n\ninit\nDoes initialization required before this can be run. This includes open()ing the file, if\nnecessary, and clearing the destination scalar if necessary.\n\nopen\nIf a filename was passed in, opens it. Determines if the handle is open via fileno(). Throws\nan exception on error.\n\nopenpipe\nIf this is a redirection IO object, this opens the pipe in a platform independent manner.\n\nclose\nCloses the handle. Throws an exception on failure.\n\nfileno\nReturns the fileno of the handle. Throws an exception on failure.\n\nmode\nReturns the operator in terms of 'r', 'w', and 'a'. There is a state 'ra', unlike Perl's\nopen(), which indicates that data read from the handle or file will be appended to the\noutput if the output is a scalar. This is only meaningful if the output is a scalar, it has\nno effect if the output is a subroutine.\n\nThe redirection operators can be a little confusing, so here's a reference table:\n\n>      r      Read from handle in to process\n<      w      Write from process out to handle\n>>     ra     Read from handle in to process, appending it to existing\ndata if the destination is a scalar.\n<<     wa     Write from process out to handle, appending to existing\ndata if IPC::Run::IO opened a named file.\n\nop  Returns the operation: '<', '>', '<<', '>>'. See \"mode\" if you want to spell these 'r', 'w',\netc.\n\nbinmode\nSets/gets whether this pipe is in binmode or not. No effect off of Win32 OSs, of course, and\non Win32, no effect after the harness is start()ed.\n\ndir Returns the first character of $self->op. This is either \"<\" or \">\".\n\npoll\nTODO: Needs confirmation that this is correct. Was previously undocumented.\n\nI believe this is polling the IO for new input and then returns undef if there will never be\nany more input, 0 if there is none now, but there might be in the future, and TRUE if more\ninput was gotten.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Barrie Slaymaker <barries@slaysys.com>\n",
                "subsections": []
            },
            "TODO": {
                "content": "Implement bidirectionality.\n",
                "subsections": []
            }
        }
    }
}