MCPcopy Create free account
hub / github.com/PyTables/PyTables / create_hard_link

Method create_hard_link

tables/file.py:1643–1667  ·  view source on GitHub ↗

Create a hard link. Create a hard link to a `target` node with the given `name` in `where` location. `target` can be a node object or a path string. If `createparents` is true, the intermediate groups required for reaching `where` are created (the default is not

(
        self,
        where: Node | str,
        name: str,
        target: Node | str,
        createparents: bool = False,
    )

Source from the content-addressed store, hash-verified

1641 return ptobj
1642
1643 def create_hard_link(
1644 self,
1645 where: Node | str,
1646 name: str,
1647 target: Node | str,
1648 createparents: bool = False,
1649 ) -> Group | Leaf:
1650 """Create a hard link.
1651
1652 Create a hard link to a `target` node with the given `name` in
1653 `where` location. `target` can be a node object or a path
1654 string. If `createparents` is true, the intermediate groups
1655 required for reaching `where` are created (the default is not
1656 doing so).
1657
1658 The returned node is a regular `Group` or `Leaf` instance.
1659
1660 """
1661 targetnode = self.get_node(target)
1662 parentnode = self._get_or_create_path(where, createparents)
1663 linkextension._g_create_hard_link(parentnode, name, targetnode)
1664 # Refresh children names in link's parent node
1665 parentnode._g_add_children_names()
1666 # Return the target node
1667 return self.get_node(parentnode, name)
1668
1669 def create_soft_link(
1670 self,

Callers 5

_g_copy_childrenMethod · 0.80
_f_copy_childrenMethod · 0.80
make_test_fileFunction · 0.80
_createFileMethod · 0.80
links.pyFile · 0.80

Calls 3

get_nodeMethod · 0.95
_get_or_create_pathMethod · 0.95
_g_add_children_namesMethod · 0.80

Tested by 1

_createFileMethod · 0.64