Expand warning at the top.
[p5sagit/p5-mst-13.2.git] / ext / IO / lib / IO / Seekable.pm
CommitLineData
8add82fc 1#
2
3package IO::Seekable;
4
5=head1 NAME
6
7IO::Seekable - supply seek based methods for I/O objects
8
9=head1 DESCRIPTION
10
11C<IO::Seekable> does not have a constuctor of its own as is intended to
12be inherited by other C<IO::Handle> based objects. It provides methods
13which allow seeking of the file descriptors.
14
15If the C functions fgetpos() and fsetpos() are available, then
16C<IO::File::getpos> returns an opaque value that represents the
17current position of the IO::File, and C<IO::File::setpos> uses
18that value to return to a previously visited position.
19
20See L<perlfunc> for complete descriptions of each of the following
21supported C<IO::Seekable> methods, which are just front ends for the
22corresponding built-in functions:
23
24 clearerr
25 seek
26 tell
27
28=head1 SEE ALSO
29
30L<perlfunc>,
31L<perlop/"I/O Operators">,
32L<"IO::Handle">
33L<"IO::File">
34
35=head1 HISTORY
36
37Derived from FileHandle.pm by Graham Barr <bodg@tiuk.ti.com>
38
39=head1 REVISION
40
41$Revision: 1.4 $
42
43=cut
44
45require 5.000;
46use Carp;
47use vars qw($VERSION @EXPORT @ISA);
48use IO::Handle qw(SEEK_SET SEEK_CUR SEEK_END);
49require Exporter;
50
51@EXPORT = qw(SEEK_SET SEEK_CUR SEEK_END);
52@ISA = qw(Exporter);
53
54$VERSION = sprintf("%d.%02d", q$Revision: 1.4 $ =~ /(\d+)\.(\d+)/);
55
56sub clearerr {
57 @_ == 1 or croak 'usage: $fh->clearerr()';
58 seek($_[0], 0, SEEK_CUR);
59}
60
61sub seek {
62 @_ == 3 or croak 'usage: $fh->seek(POS, WHENCE)';
63 seek($_[0], $_[1], $_[2]);
64}
65
66sub tell {
67 @_ == 1 or croak 'usage: $fh->tell()';
68 tell($_[0]);
69}
70
711;