{
    "mode": "perldoc",
    "parameter": "IO::Seekable",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/IO%3A%3ASeekable/json",
    "generated": "2026-06-10T11:57:01Z",
    "synopsis": "use IO::Seekable;\npackage IO::Something;\n@ISA = qw(IO::Seekable);",
    "sections": {
        "NAME": {
            "content": "IO::Seekable - supply seek based methods for I/O objects\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use IO::Seekable;\npackage IO::Something;\n@ISA = qw(IO::Seekable);\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "\"IO::Seekable\" does not have a constructor of its own as it is intended to be inherited by other\n\"IO::Handle\" based objects. It provides methods which allow seeking of the file descriptors.\n\n$io->getpos\nReturns an opaque value that represents the current position of the IO::File, or \"undef\" if\nthis is not possible (eg an unseekable stream such as a terminal, pipe or socket). If the\nfgetpos() function is available in your C library it is used to implements getpos, else perl\nemulates getpos using C's ftell() function.\n\n$io->setpos\nUses the value of a previous getpos call to return to a previously visited position. Returns\n\"0 but true\" on success, \"undef\" on failure.\n\nSee perlfunc for complete descriptions of each of the following supported \"IO::Seekable\"\nmethods, which are just front ends for the corresponding built-in functions:\n\n$io->seek ( POS, WHENCE )\nSeek the IO::File to position POS, relative to WHENCE:\n\nWHENCE=0 (SEEKSET)\nPOS is absolute position. (Seek relative to the start of the file)\n\nWHENCE=1 (SEEKCUR)\nPOS is an offset from the current position. (Seek relative to current)\n\nWHENCE=2 (SEEKEND)\nPOS is an offset from the end of the file. (Seek relative to end)\n\nThe SEEK* constants can be imported from the \"Fcntl\" module if you don't wish to use the\nnumbers 0 1 or 2 in your code.\n\nReturns 1 upon success, 0 otherwise.\n\n$io->sysseek( POS, WHENCE )\nSimilar to $io->seek, but sets the IO::File's position using the system call lseek(2)\ndirectly, so will confuse most perl IO operators except sysread and syswrite (see perlfunc\nfor full details)\n\nReturns the new position, or \"undef\" on failure. A position of zero is returned as the\nstring \"0 but true\"\n\n$io->tell\nReturns the IO::File's current position, or -1 on error.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "perlfunc, \"I/O Operators\" in perlop, IO::Handle IO::File\n",
            "subsections": []
        },
        "HISTORY": {
            "content": "Derived from FileHandle.pm by Graham Barr <gbarr@pobox.com>\n",
            "subsections": []
        }
    },
    "summary": "IO::Seekable - supply seek based methods for I/O objects",
    "flags": [],
    "examples": [],
    "see_also": []
}