PyDocs

Nav

Generic Operating System Services

IOBase.seek

io

method of IOBase · Added in 3.1
  • IOBase.seek(offset, whence=os.SEEK_SET, /)
Change the stream position to the given byte offset.

  offset
    The stream position, relative to 'whence'.
  whence
    The relative position to seek from.

The offset is interpreted relative to the position indicated by
whence.  Values for whence are:

* os.SEEK_SET or 0 -- start of stream (the default); offset should
  be zero or positive
* os.SEEK_CUR or 1 -- current stream position; offset may be
  negative
* os.SEEK_END or 2 -- end of stream; offset is usually negative

Return the new absolute position.
Changed in 3.3
  • 3.3: Some operating systems could support additional values, like os.SEEK_HOLE or os.SEEK_DATA. The valid values for a file could depend on it being open in text or binary mode.
0 Examples
No examples for io/IOBase.seek.
See Also
No see-alsos for io/IOBase.seek
0 Notes
No notes for IOBase.seek