-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-37129: Add os.RWF_APPEND flag for os.pwritev #13735
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
Changes from all commits
98608b9
f4ab619
10c34b4
d0cedc4
2504743
8ba3028
884466e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -1196,6 +1196,7 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo | |||||
|
||||||
- :data:`RWF_DSYNC` | ||||||
- :data:`RWF_SYNC` | ||||||
- :data:`RWF_APPEND` | ||||||
|
||||||
Return the total number of bytes actually written. | ||||||
|
||||||
|
@@ -1230,6 +1231,16 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo | |||||
.. versionadded:: 3.7 | ||||||
|
||||||
|
||||||
.. data:: RWF_APPEND | ||||||
|
||||||
Append data to the end of the file. See the description of the flag 'O_APPEND' in ''os.open()''. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'O_APPEND' should be written :data: ''os.open()'' should be written :func: But os.open() doesn't document O_APPEND, just "The above constants are available on Unix and Windows"... I would prefer to copy preadv Linux manual page:
(Adapt it to Python names.) |
||||||
The *offset* field is ignored. The file *offset* is not changed. | ||||||
|
||||||
.. availability:: Linux 4.16 and newer. | ||||||
|
||||||
.. versionadded:: 3.8 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
|
||||||
.. function:: read(fd, n) | ||||||
|
||||||
Read at most *n* bytes from file descriptor *fd*. | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
add RWF_APPEND flag | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest:
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14023,6 +14023,9 @@ all_ins(PyObject *m) | |
#ifdef RWF_NOWAIT | ||
if (PyModule_AddIntConstant(m, "RWF_NOWAIT", RWF_NOWAIT)) return -1; | ||
#endif | ||
#ifdef RWF_APPEND | ||
if (PyModule_AddIntConstant(m, "RWF_APPEND", RWF_APPEND)) return -1; | ||
#endif | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to add |
||
/* constants for posix_spawn */ | ||
#ifdef HAVE_POSIX_SPAWN | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry "Provide a per-write equivalent of the
O_APPEND
inos.open()
. This flag effect applies only to the data range written by the system call. The offset argument does not affect the write operation; the data is always appended to the end of the file. However, if the offset argument is-1
, the current file offset is updated." I am sure vstinner will want to change this description again :)