On Thursday 31 January 2008 08:00:29 am Francesc Altet wrote:
> A Thursday 31 January 2008, escriguéreu:
> > On Thursday 31 January 2008 3:06:58 am Francesc Altet wrote:
> > > A Wednesday 30 January 2008, Darren Dale escrigué:
> > > > Hello,
> > > >
> > > > Is it possible to create hard and soft links in pytables files? I
> > > > am trying to follow the NeXus format
> > > > (http://www.nexusformat.org/Design#NeXus_Data), which uses hard
> > > > links.
> > >
> > > Uh, no, this is in our TODO list, but it is not implemented yet,
> > > sorry.
> >
> > Thanks for the quick response. Are you targeting a particular release
> > for this feature? Any ideas about how the public interface interface
> > would look? I spent the last two days learning pyrex and how pytables
> > is structured (very impressive). Maybe I could take a shot at
> > contributing something to your great library.
>
> Oh, that would be great. Unfortunately, we have not a a particular
> deadline in implementing this.  Besides, we have not thought yet about
> an API for links, but if you are going to take a shot at this, you can
> make a proposal and we can give you our feedback.
>
> Please do not hesitate to ask if you need help or guidance,

It looks like pytables already works well with existing hard links. I wanted 
to ask though if there might be any caching issues lurking beneath the 
surface that I should investigate. An example data set is attached (created 
with the nexus library using Paul Kienzle's python wrapper) where 
t.root.entry.r8_data is a 5x4 64bit float array and t.root.link.renLinkData 
is a hard link to the same. I can modify the array following either path, and 
support looks completely transparent, but I just wanted to be sure.

It looks like rounding out support for hard links would simply require adding 
a new method to File to create the link. I propose something like

File.linkNode(self, where, name, curObject)
or
File.createLink(self, where, name, curObject)

The argument list here follows the pattern in createTable.

Soft links would take more work. I don't think I would use them myself, so I 
probably am the wrong person to suggest their implementation. Maybe they 
would require a new pytables object deriving from Leaf, I don't really know 
how such a thing should behave. They could be added later, and be created 
with the same file method through the addition of a linktype kwarg that 
defaults to hard links.

Comments or suggestions?

Darren

-- 
Darren S. Dale, Ph.D.
Staff Scientist
Cornell High Energy Synchrotron Source
Cornell University
275 Wilson Lab
Rt. 366 & Pine Tree Road
Ithaca, NY 14853

[EMAIL PROTECTED]
office: (607) 255-3819
fax: (607) 255-9001
http://www.chess.cornell.edu

Attachment: NXtest.h5
Description: Binary data

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to