Hard links ``src`` to ``dst``, returning 0 or errno. Note that the special errno ``ENOLINK`` will be returned if ``os.link`` isn't supported by the operating system.
(src, dst)
| 284 | ENOLINK = 1998 |
| 285 | |
| 286 | def link(src, dst): |
| 287 | """Hard links ``src`` to ``dst``, returning 0 or errno. |
| 288 | |
| 289 | Note that the special errno ``ENOLINK`` will be returned if ``os.link`` isn't |
| 290 | supported by the operating system. |
| 291 | """ |
| 292 | |
| 293 | if not hasattr(os, "link"): |
| 294 | return ENOLINK |
| 295 | link_errno = 0 |
| 296 | try: |
| 297 | os.link(src, dst) |
| 298 | except OSError as e: |
| 299 | link_errno = e.errno |
| 300 | return link_errno |
| 301 | |
| 302 | |
| 303 | def link_or_copy(src, dst): |
no outgoing calls
no test coverage detected
searching dependent graphs…