7 IO::Seekable - supply seek based methods for I/O objects
12 package IO::Something;
13 @ISA = qw(IO::Seekable);
17 C<IO::Seekable> does not have a constructor of its own as it is intended to
18 be inherited by other C<IO::Handle> based objects. It provides methods
19 which allow seeking of the file descriptors.
21 If the C functions fgetpos() and fsetpos() are available, then
22 C<$io-E<lt>getpos> returns an opaque value that represents the
23 current position of the IO::File, and C<$io-E<gt>setpos(POS)> uses
24 that value to return to a previously visited position.
26 See L<perlfunc> for complete descriptions of each of the following
27 supported C<IO::Seekable> methods, which are just front ends for the
28 corresponding built-in functions:
30 $io->seek( POS, WHENCE )
31 $io->sysseek( POS, WHENCE )
37 L<perlop/"I/O Operators">,
43 Derived from FileHandle.pm by Graham Barr E<lt>gbarr@pobox.comE<gt>
50 our($VERSION, @EXPORT, @ISA);
51 use IO::Handle qw(SEEK_SET SEEK_CUR SEEK_END);
54 @EXPORT = qw(SEEK_SET SEEK_CUR SEEK_END);
60 @_ == 3 or croak 'usage: $io->seek(POS, WHENCE)';
61 seek($_[0], $_[1], $_[2]);
65 @_ == 3 or croak 'usage: $io->sysseek(POS, WHENCE)';
66 sysseek($_[0], $_[1], $_[2]);
70 @_ == 1 or croak 'usage: $io->tell()';