diff options
author | Steve Dower <steve.dower@python.org> | 2021-04-07 18:23:30 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-07 18:23:30 (GMT) |
commit | 9f578734624d1c0172220556ca97898730144172 (patch) | |
tree | fa3c0a72679116f9b2c24ba14183af55b1844501 /Doc | |
parent | d0e858d82d493d5341d80f34c7a09094e27ea0ce (diff) | |
download | cpython-9f578734624d1c0172220556ca97898730144172.zip cpython-9f578734624d1c0172220556ca97898730144172.tar.gz cpython-9f578734624d1c0172220556ca97898730144172.tar.bz2 |
bpo-42999: Expand and clarify pathlib.Path.link_to() documentation. (GH-24294)
Co-authored-by: Barney Gale <barney.gale@gmail.com>
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/pathlib.rst | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index 4518f56..1aae596 100644 --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -1063,6 +1063,20 @@ call fails (for example because the path doesn't exist). of :func:`os.symlink`'s. +.. method:: Path.link_to(target) + + Make *target* a hard link to this path. + + .. warning:: + + This function does not make this path a hard link to *target*, despite + the implication of the function and argument names. The argument order + (target, link) is the reverse of :func:`Path.symlink_to`, but matches + that of :func:`os.link`. + + .. versionadded:: 3.8 + + .. method:: Path.touch(mode=0o666, exist_ok=True) Create a file at this given path. If *mode* is given, it is combined @@ -1087,13 +1101,6 @@ call fails (for example because the path doesn't exist). The *missing_ok* parameter was added. -.. method:: Path.link_to(target) - - Create a hard link pointing to a path named *target*. - - .. versionadded:: 3.8 - - .. method:: Path.write_bytes(data) Open the file pointed to in bytes mode, write *data* to it, and close the |