[issue41625] Add splice() to the os module

Pablo Galindo Salgado report at bugs.python.org
Mon Aug 24 13:30:18 EDT 2020


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

> I don't recall the subtle differences between sendfile() and splice().

Basically, splice() is specialized for pipes:


splice() only works if one of the file descriptors refer to a pipe. So you can use for e.g. socket-to-pipe or pipe-to-file without copying the data into userspace. But you can't do file-to-file copies with it.

sendfile() only works if the source file descriptor refers to something that can be mmap()ed (i.e. mostly normal files) and before 2.6.33 the destination must be a socket.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41625>
_______________________________________


More information about the Python-bugs-list mailing list