[Python-ideas] File system API

Tal Einat tal.no.no.spam at gmail.com
Fri Feb 2 12:22:53 CET 2007


I'm proposing a general file-system API (for Python of course).
Basically, that's it.


I've been wondering how many thousands of times this has been
discussed, but an hour's worth of searching the net actually gave very
little on this subject. Most other proposals I've seen started far,
far further into developing the idea, and I think it's worth giving it
a fresh start from the beginning.

Also, most proposals centered around either creating efficient fake
file-systems, simplifying working with paths, or unifying
functionality currently spread between several Python modules. I
believe these can be achieved, and more - but let's first think what
other goals can be achieved, which goals conflict with each other, and
which are the most important.


Just for a taste: The OS's file system would be an instance of a class
implementing this API. Other examples of classes which would implement
this API: FTP implementations, file system proxies in RPC frameworks,
and "fake" file systems for testing purposes. (This last example -
testing - is where most of the discussion I've seen on this subject
was centered.) Surely more uses can be found - I think we should think
through the uses cases before thinking of design.

Personally, my need is for a remote file-system proxy - my application
runs multiple remote servers, and I need to work with a virtual file
system on each server. Currently the code for this is quite horrid
(low-level hackery); with an API for file-systems I would just need to
wrap the local file-system with a proxy class and be done.

Obviously I have some initial ideas concerning design, but I haven't
hacked at file-systems much yet, and I'd like to hear what more
experienced people have to say.


So let's leave out design and implementation ideas for later, and focus on:
* What would be the uses for this (e.g. file-system proxies)
* What would be the benefits and drawbacks
* Is there any reason why this would not be possible
* Is this a good idea at all (or are we better off without it)
* How important do we think this is (for the betterment of Python)


- Tal Einat
reduce(lambda m,x:[m[i]+s[-1] for i,s in enumerate(sorted(m))],
      [[chr(154-ord(c)) for c in '.&-&,l.Z95193+179-']]*18)[3]



More information about the Python-ideas mailing list