Abstract base class for all PyTables links.
A link is a node that refers to another node. The Link class inherits from Node class and the links that inherits from Link are SoftLink and ExternalLink. There is not a HardLink subclass because hard links behave like a regular Group or Leaf. Contrarily to other nodes, links cannot have HDF5 attributes. This is an HDF5 library limitation that might be solved in future releases.
See Using links for more convenient access to nodes for a small tutorial on how to work with links.
Link attributes
The path string to the pointed node.
The following methods are useful for copying, moving, renaming and removing links.
Copy this link and return the new one.
See Node._f_copy() for a complete explanation of the arguments. Please note that there is no recursive flag since links do not have child nodes.
Move or rename this link.
See Node._f_move() for a complete explanation of the arguments.
Rename this link in place.
See Node._f_rename() for a complete explanation of the arguments.
Represents a soft link (aka symbolic link).
A soft link is a reference to another node in the same file hierarchy. Getting access to the pointed node (this action is called dereferrencing) is done via the __call__ special method (see below).
The following methods are specific for dereferrencing and representing soft links.
Represents an external link.
An external link is a reference to a node in another file. Getting access to the pointed node (this action is called dereferencing) is done via the __call__() special method (see below).
ExternalLink attributes
The external file handler, if the link has been dereferenced. In case the link has not been dereferenced yet, its value is None.
The following methods are specific for dereferrencing and representing external links.
Dereference self.target and return the object.
You can pass all the arguments supported by the open_file() function (except filename, of course) so as to open the referenced external file.
Examples
>>> f=tables.open_file('data1/test1.h5')
>>> print f.root.link2
/link2 (ExternalLink) -> data2/test2.h5:/path/to/node
>>> plink2 = f.root.link2('a') # open in 'a'ppend mode
>>> print plink2
/path/to/node (Group) ''
>>> print plink2._v_filename
'data2/test2.h5' # belongs to referenced file