| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6db39b1 commit dd4442c
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1163,17 +1163,22 @@ as internal buffering of data. | |||
| 1163 | 1163 | .. versionadded:: 3.11 | |
| 1164 | 1164 | ||
| 1165 | 1165 | ||
| 1166 | - .. function:: lseek(fd, pos, how, /) | ||
| 1166 | + .. function:: lseek(fd, pos, whence, /) | ||
| 1167 | 1167 | ||
| 1168 | 1168 | Set the current position of file descriptor *fd* to position *pos*, modified | |
| 1169 | - by *how*: :const:`SEEK_SET` or ``0`` to set the position relative to the | ||
| 1170 | - beginning of the file; :const:`SEEK_CUR` or ``1`` to set it relative to the | ||
| 1171 | - current position; :const:`SEEK_END` or ``2`` to set it relative to the end of | ||
| 1172 | - the file. Return the new cursor position in bytes, starting from the beginning. | ||
| 1169 | + by *whence*, and return the new position in bytes relative to | ||
| 1170 | + the start of the file. | ||
| 1171 | + Valid values for *whence* are: | ||
| 1172 | + | ||
| 1173 | + * :const:`SEEK_SET` or ``0`` -- set *pos* relative to the beginning of the file | ||
| 1174 | + * :const:`SEEK_CUR` or ``1`` -- set *pos* relative to the current file position | ||
| 1175 | + * :const:`SEEK_END` or ``2`` -- set *pos* relative to the end of the file | ||
| 1176 | + * :const:`SEEK_HOLE` -- set *pos* to the next data location, relative to *pos* | ||
| 1177 | + * :const:`SEEK_DATA` -- set *pos* to the next data hole, relative to *pos* | ||
| 1173 | 1178 | ||
| 1174 | 1179 | .. versionchanged:: 3.3 | |
| 1175 | 1180 | ||
| 1176 | - Add support for :const:`SEEK_HOLE` and :const:`SEEK_DATA`. | ||
| 1181 | + Add support for :const:`!SEEK_HOLE` and :const:`!SEEK_DATA`. | ||
| 1177 | 1182 | ||
| 1178 | 1183 | ||
| 1179 | 1184 | .. data:: SEEK_SET | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10424,19 +10424,24 @@ os_lockf_impl(PyObject *module, int fd, int command, Py_off_t length) | |||
| 10424 | 10424 | os.lseek -> Py_off_t | |
| 10425 | 10425 | ||
| 10426 | 10426 | fd: int | |
| 10427 | + An open file descriptor, as returned by os.open(). | ||
| 10427 | 10428 | position: Py_off_t | |
| 10428 | - how: int | ||
| 10429 | + Position, interpreted relative to 'whence'. | ||
| 10430 | + whence as how: int | ||
| 10431 | + The relative position to seek from. Valid values are: | ||
| 10432 | + - SEEK_SET: seek from the start of the file. | ||
| 10433 | + - SEEK_CUR: seek from the current file position. | ||
| 10434 | + - SEEK_END: seek from the end of the file. | ||
| 10429 | 10435 | / | |
| 10430 | 10436 | ||
| 10431 | 10437 | Set the position of a file descriptor. Return the new position. | |
| 10432 | 10438 | ||
| 10433 | - Return the new cursor position in number of bytes | ||
| 10434 | - relative to the beginning of the file. | ||
| 10439 | + The return value is the number of bytes relative to the beginning of the file. | ||
| 10435 | 10440 | [clinic start generated code]*/ | |
| 10436 | 10441 | ||
| 10437 | 10442 | static Py_off_t | |
| 10438 | 10443 | os_lseek_impl(PyObject *module, int fd, Py_off_t position, int how) | |
| 10439 | - /*[clinic end generated code: output=971e1efb6b30bd2f input=902654ad3f96a6d3]*/ | ||
| 10444 | + /*[clinic end generated code: output=971e1efb6b30bd2f input=f096e754c5367504]*/ | ||
| 10440 | 10445 | { | |
| 10441 | 10446 | Py_off_t result; | |
| 10442 | 10447 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments