[Twisted-Python] Re: +AFs-Twisted-Python+AF0- twisted.ftp status, and metadatafs

Benjamin Bruheim grolgh at online.no
Sat Sep 1 12:31:11 MDT 2001


> 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'].

Yes, I figured :) I made the same mistake when writing my first vfs draft [1] some time ago. At least it got mount.

> 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.

Useful for a zip-fs :) My gut-reaction would say that '/foo/bar' is a file, '/foo/bar/' is a directory. In ftp this is a matter of having a client which can handle it (but it will without doubt create problems on _many_ clients), most of the trouble is solved through context 'RETR <file>' vs 'CD <dir>'; but it wont solve 'SITE CHMOD <path>' (not implemented :P ). Such cases will create problems, but this is due to badly specified protocols. PB won't have this problem ;)

> 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.)

Two different systems? You mean WebDAV and a FTP? Yes, it sounds interesting, though I have to read a bit more on it to understand WebDAV's concept. It seems to fill most of the requirements. The VFS will maybe be just a storage-specific layer, while WebDAV is built on top of it. I need to read on it before I try to fill in anything more. :)

[1]: http://www.twistedmatrix.com/users/phed/vfs.py









More information about the Twisted-Python mailing list