man-pages/man3/IO::InnerFile.3pm.html
2021-03-31 01:06:50 +01:00

166 lines
3.3 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of IO::InnerFile</TITLE>
</HEAD><BODY>
<H1>IO::InnerFile</H1>
Section: User Contributed Perl Documentation (3pm)<BR>Updated: 2019-02-28<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
IO::InnerFile - define a file inside another file
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<PRE>
### Read a subset of a file:
$inner = IO::InnerFile-&gt;new($fh, $start, $length);
while (&lt;$inner&gt;) {
...
}
</PRE>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
If you have a filehandle that can <B>seek()</B> and <B>tell()</B>, then you
can open an IO::InnerFile on a range of the underlying file.
<A NAME="lbAE">&nbsp;</A>
<H2>PUBLIC INTERFACE</H2>
<DL COMPACT>
<DT id="1">new <FONT SIZE="-1">FILEHANDLE,</FONT> [<FONT SIZE="-1">START,</FONT> [<FONT SIZE="-1">LENGTH</FONT>]]<DD>
<I>Class method, constructor.</I>
Create a new inner-file opened on the given <FONT SIZE="-1">FILEHANDLE,</FONT>
from bytes <FONT SIZE="-1">START</FONT> to <FONT SIZE="-1">START+LENGTH.</FONT> Both <FONT SIZE="-1">START</FONT> and <FONT SIZE="-1">LENGTH</FONT>
default to 0; negative values are silently coerced to zero.
<P>
Note that <FONT SIZE="-1">FILEHANDLE</FONT> must be able to <B>seek()</B> and <B>tell()</B>, in addition
to whatever other methods you may desire for reading it.
<DT id="2">set_length <FONT SIZE="-1">LENGTH</FONT><DD>
<DT id="3">get_length<DD>
<DT id="4">add_length <FONT SIZE="-1">NBYTES</FONT><DD>
<I>Instance methods.</I>
Get/set the virtual length of the inner file.
<DT id="5">set_start <FONT SIZE="-1">START</FONT><DD>
<DT id="6">get_start<DD>
<DT id="7">add_start <FONT SIZE="-1">NBYTES</FONT><DD>
<I>Instance methods.</I>
Get/set the virtual start position of the inner file.
<DT id="8">binmode<DD>
<DT id="9">close<DD>
<DT id="10">flush<DD>
<DT id="11">getc<DD>
<DT id="12">getline<DD>
<DT id="13">print <FONT SIZE="-1">LIST</FONT><DD>
<DT id="14">printf <FONT SIZE="-1">LIST</FONT><DD>
<DT id="15">read <FONT SIZE="-1">BUF, NBYTES</FONT><DD>
<DT id="16">readline<DD>
<DT id="17">seek <FONT SIZE="-1">OFFFSET, WHENCE</FONT><DD>
<DT id="18">tell<DD>
<DT id="19">write <FONT SIZE="-1">ARGS...</FONT><DD>
<I>Instance methods.</I>
Standard filehandle methods.
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>VERSION</H2>
<TT>$Id:</TT> InnerFile.pm,v 1.4 2005/02/10 21:21:53 dfs Exp $
<A NAME="lbAG">&nbsp;</A>
<H2>AUTHOR</H2>
Original version by Doru Petrescu (<A HREF="mailto:pdoru@kappa.ro">pdoru@kappa.ro</A>).
<P>
Documentation and by Eryq (<A HREF="mailto:eryq@zeegee.com">eryq@zeegee.com</A>).
<P>
Currently maintained by Dianne Skoll (<A HREF="mailto:dfs@roaringpenguin.com">dfs@roaringpenguin.com</A>).
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="20"><A HREF="#lbAB">NAME</A><DD>
<DT id="21"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="22"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="23"><A HREF="#lbAE">PUBLIC INTERFACE</A><DD>
<DT id="24"><A HREF="#lbAF">VERSION</A><DD>
<DT id="25"><A HREF="#lbAG">AUTHOR</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:46 GMT, March 31, 2021
</BODY>
</HTML>