A Friday 04 December 2009 16:51:18 escriguéreu:
> Francesc,
> 
> I 've tried the svn version of links pytables.
> No problem to build the package on Ubuntu 9.10 against HDF5 1.8.4 and
>  python 2.5.4.
> 
> The walkNodes function prints the external link.
> Perhaps it should tranparently read the linked file ...

I've thought about transparently expanding soft/external links, but decided 
not to do this so that the user can still access the SoftLink/ExternalLink 
object so that he can interact with them exactly like any other Node object.  

Here you have an example of use:

-------------------------------------------------------------------------
import tables

# Create the external linked file first
f = tables.openFile('elink2.h5', 'w')
pep = f.createGroup('/', 'pep')
f.close()

f = tables.openFile('elink.h5', 'w')
pep = f.createGroup('/', 'pep')
elink = f.createExternalLink('/', 'pep2', 'elink2.h5:/pep')
print f
print "External Link Node-->", elink
enode = elink()      # use __call__ special method for dereferring
print "Referred external node-->", enode
print "Referred external file-->", enode._v_file.filename
f.close()
--------------------------------------------------------------------------

and the output:

"""
elink.h5 (File) ''
Last modif.: 'Fri Dec  4 17:55:03 2009'
Object Tree:
/ (RootGroup) ''
/pep2 (ExternalLink) -> elink2.h5:/pep
/pep (Group) ''

External Link Node--> /pep2 (ExternalLink) -> elink2.h5:/pep
Referred external node--> /pep (Group) ''
Referred external file--> elink2.h5
"""

You can find more examples of use in the tables/tests/test_link.py file.

Cordialement,

-- 
Francesc Alted

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to