Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(8)

Unified Diff: Doc/library/os.rst

Issue 26826: Expose new copy_file_range() syscal in os module and use it to improve shutils.copy()
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « configure.ac ('k') | Lib/test/test_os.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Doc/library/os.rst Wed Jun 08 13:32:49 2016 +0000
+++ b/Doc/library/os.rst Wed Jul 06 12:59:50 2016 +0200
@@ -680,6 +680,27 @@
pass
+.. function:: copy_file_range(src, dst, count, offset_src=None, offset_dst=None)
+
+ Copy *count* bytes from file descriptor *src*, starting from offset
+ *offset_src*, to file descriptor *dst*, starting from offset *offset_dst*.
+ If *offset_src* is None, then *src* is read from the current position;
+ respectively for *offset_dst*. The files pointed by *src* and *dst*
+ must reside in the same filesystem, otherwise a :exc:`OSError` is
+ raised with :attr:`~OSError.errno` set to :data:`errno.EXDEV`.
+
+ This copy is done without using any user space buffers, and some
+ filesystems could implement optimizations. The copy is done as if
+ both files are opened as binary.
+
+ The return value is the amount of bytes copied. This could be less than the
+ amount requested.
+
+ Availability: Linux 4.5, released May 2016 (see the man page
+ :manpage:`copy_file_range(2)` for further information).
+
+ .. versionadded:: 3.6
+
.. function:: device_encoding(fd)
Return a string describing the encoding of the device associated with *fd*
« no previous file with comments | « configure.ac ('k') | Lib/test/test_os.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+