Benjamin Bruheim wrote:
So, if I jump forward in time, and extend the view to storing eg. media-files generally, I think the need of a vfs of some kind arises. What follows is some random notes on it, with varying value, and passing the scope of twisted.ftp with lightyears.
Take a look at Medusa (www.nightmare.com/medusa) VFS as an example of how *not* to do it. One thing I learned from it - string paths are EVIL, especially in FTP where paths such as /baz/.././//foo/../bar are legal. Paths should therefore be represented by lists, e.g. ['baz', 'foo', 'bar']. The next problem is that it's usually hard to know if the last item is a file or a folder (if the path is '/foo/bar', is 'bar' a file or a folder?). In systems like Zope it's even harder since an object can function as both. I would suggest you get a WebDAV implementation going before you (or any other interested party) start working on a VFS layer. WebDAV is more generic (it support "collections", not "folders"), supports arbitary properties on objects (metadata), etc.. And supporting two different systems will amke sure you don't make any protocol specific design decisions (such as Medusa's VFS, where it passes the VFS the path string specified by the user, so the VFS must deal with '..', './../foo//bar' and all that crap.)