copy data from file-like object fsrc to file-like object fdst
(fsrc, fdst, length=0)
| 247 | fdst_write(mv) |
| 248 | |
| 249 | def copyfileobj(fsrc, fdst, length=0): |
| 250 | """copy data from file-like object fsrc to file-like object fdst""" |
| 251 | if not length: |
| 252 | length = COPY_BUFSIZE |
| 253 | # Localize variable access to minimize overhead. |
| 254 | fsrc_read = fsrc.read |
| 255 | fdst_write = fdst.write |
| 256 | while buf := fsrc_read(length): |
| 257 | fdst_write(buf) |
| 258 | |
| 259 | def _samefile(src, dst): |
| 260 | # Macintosh, Unix. |
no outgoing calls
no test coverage detected
searching dependent graphs…