MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / link_to

Method link_to

tools/python-3.11.9-amd64/Lib/pathlib.py:1210–1226  ·  view source on GitHub ↗

Make the target path a hard link pointing to this path. Note this function does not make this path a hard link to *target*, despite the implication of the function and argument names. The order of arguments (target, link) is the reverse of Path.symlink_to, but

(self, target)

Source from the content-addressed store, hash-verified

1208 os.link(target, self)
1209
1210 def link_to(self, target):
1211 """
1212 Make the target path a hard link pointing to this path.
1213
1214 Note this function does not make this path a hard link to *target*,
1215 despite the implication of the function and argument names. The order
1216 of arguments (target, link) is the reverse of Path.symlink_to, but
1217 matches that of os.link.
1218
1219 Deprecated since Python 3.10 and scheduled for removal in Python 3.12.
1220 Use `hardlink_to()` instead.
1221 """
1222 warnings.warn("pathlib.Path.link_to() is deprecated and is scheduled "
1223 "for removal in Python 3.12. "
1224 "Use pathlib.Path.hardlink_to() instead.",
1225 DeprecationWarning, stacklevel=2)
1226 self.__class__(target).hardlink_to(self)
1227
1228 # Convenience functions for querying the stat results
1229

Callers

nothing calls this directly

Calls 3

hardlink_toMethod · 0.80
warnMethod · 0.45
__class__Method · 0.45

Tested by

no test coverage detected