Does Python support zero-copy I/O?

后端 未结 2 1331
广开言路
广开言路 2021-02-13 19:37

I have two open file objects, dest and src. File object dest is opened for writing, with the seek position placed at some offset within th

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-13 20:12

    Since version 3.3, Python has os.sendfile, which interfaces to various Unix variants' sendfile(2) zero-copy I/O interfaces. It operates on file descriptors, not general file-like objects. For older Pythons, there's py-sendfile.

提交回复
热议问题