[Twisted-Python] twisted.vfs issues

James Y Knight foom at fuhm.net
Wed Sep 28 20:39:34 EDT 2005

On Sep 28, 2005, at 3:49 PM, Andy Gayton wrote:
> There's getMetadata. That let's you return arbitrary attributes.
> Would that cover what you're thinking?

No -- one problem is that extended metadata can be potentially very  
large (just as large as the file's normal contents). Another is that  
there may be potentially a large number of such attributes. So, you  
really don't want to return all of it with one call -- you want to  
explicitly ask for certain attributes. See the getxattr, listxattr,  
etc functions for what it the low-level functionality looks like in  
linux. At the moment this interface varies slightly between OSX,  
FreeBSD, and Linux, but they're almost the same. The OSX one adds an  
offset parameter to get/set, and the freebsd one adds a "namespace"  
parameter, to distinguish between root-only attributes and user  

I think it may be best to model it as a special kind of child, as it  
seems as if that's the way people are moving their thinking anyhow.
  IFileSystemNode.xattrContainer() -> IFileSystemContainer

That returned object would then allow the use of the same createFile/ 
child/remove/rename/open/read operations as on normal children. It  
would have to throw errors if you try doing excessively "interesting"  
things, like trying to create directories in it, but I think that's  
probably okay.

On the other hand, some people think xattrs are only for small  
metadata, and that "subfiles" or "named forks" are an altogether  
different thing. I'm not sure if that means that it's necessarily a  
bad idea to present both as fileish objects though.

Some interface to this is necessary for properly functioning WebDAV  
(and smb if anyone ever wanted to implement that mess).

> Protocol's should try to get by with as little metadata as they  
> can.  If a backend doesn't supply a bit of metadata a protocol must  
> have, then it won't be able to be used with the protocol.

Support for xattrs can also be optional in a backend.

Eventually, support for POSIX ACLs should also be considered. I don't  
really have the first clue how that should be modeled though.


More information about the Twisted-Python mailing list