copy data from file-like object fsrc to file-like object fdst
(fsrc, fdst, length=0)
| 187 | fdst_write(mv) |
| 188 | |
| 189 | def copyfileobj(fsrc, fdst, length=0): |
| 190 | """copy data from file-like object fsrc to file-like object fdst""" |
| 191 | if not length: |
| 192 | length = COPY_BUFSIZE |
| 193 | # Localize variable access to minimize overhead. |
| 194 | fsrc_read = fsrc.read |
| 195 | fdst_write = fdst.write |
| 196 | while True: |
| 197 | buf = fsrc_read(length) |
| 198 | if not buf: |
| 199 | break |
| 200 | fdst_write(buf) |
| 201 | |
| 202 | def _samefile(src, dst): |
| 203 | # Macintosh, Unix. |
no outgoing calls
no test coverage detected