Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.11] gh-107801: Improve the docs of the SEEK_* constants (GH-108099) #108100

Merged
merged 1 commit into from
Aug 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions Doc/library/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1070,16 +1070,26 @@ as internal buffering of data.
SEEK_CUR
SEEK_END

Parameters to the :func:`lseek` function. Their values are 0, 1, and 2,
respectively.
Parameters to the :func:`lseek` function and the :meth:`~io.IOBase.seek`
method on :term:`file-like objects <file object>`,
for whence to adjust the file position indicator.

:const:`SEEK_SET`
Adjust the file position relative to the beginning of the file.
:const:`SEEK_CUR`
Adjust the file position relative to the current file position.
:const:`SEEK_END`
Adjust the file position relative to the end of the file.

Their values are 0, 1, and 2, respectively.


.. data:: SEEK_HOLE
SEEK_DATA

Parameters to the :func:`lseek` function and the :meth:`~io.IOBase.seek`
method on file objects, for seeking file data and holes on sparsely
allocated files.
method on :term:`file-like objects <file object>`,
for seeking file data and holes on sparsely allocated files.

:data:`!SEEK_DATA`
Adjust the file offset to the next location containing data,
Expand Down