Perform a lightweight copy of two files, where the data blocks are copied only when modified. This is known as Copy on Write (CoW), instantaneous copy or reflink.
(source_fd, target_fd)
| 41 | |
| 42 | if fcntl and hasattr(fcntl, 'FICLONE'): |
| 43 | def _ficlone(source_fd, target_fd): |
| 44 | """ |
| 45 | Perform a lightweight copy of two files, where the data blocks are |
| 46 | copied only when modified. This is known as Copy on Write (CoW), |
| 47 | instantaneous copy or reflink. |
| 48 | """ |
| 49 | fcntl.ioctl(target_fd, fcntl.FICLONE, source_fd) |
| 50 | else: |
| 51 | _ficlone = None |
| 52 |
no outgoing calls
no test coverage detected
searching dependent graphs…