On 1/28/06, Stephen J. Turnbull <[EMAIL PROTECTED]> wrote:
> Please note that my point was entirely different from trying to decide
> whether to subclass strings.

Noted -- sorry I took you out of context there; that was careless.

>     Jason> Filesystem paths are in fact strings on all operating
>     Jason> systems I'm aware of.
>
> I have no idea what you could mean by that.  The data structure used
> to represent a filesystem on all OS filesystems I've used is a graph
> of directories and files.  A filesystem object is located by
> traversing a path in that graph.

You seem to think that because I said "operating systems", I'm talking
about kernel algorithms and such.  I'm not.  By "on all operating
systems" I really mean systems, not kernels:  system APIs, standard
tools, documentation, the conventions everyone follows--that sort of
thing.  Userspace.

Thought experiment:  How are filesystem paths used?  Well, programs
pass them into system calls like open() and chmod().  Programs use
them to communicate with other programs.  Users pass them to programs.
 Compare this to how you'd answer the question "How are integers
used?":  I think paths are used more for communication, less for
computation.  Their utility for communication is tightly bound to
their string-nature.

Essentially all APIs involving filesystem paths treat them as strings.
 It's not just that they take string parameters.  The way they're
designed, they encourage users to think of paths as strings, not
graph-paths.  Java's stdlib is the only API that even comes close to
distinguishing paths from strings.  The .NET class library doesn't
bother.  Many many people much smarter than I have thought about
creating non-string-oriented filesystem APIs.  Somehow it hasn't
caught on.

Essentially all users expect to see a filesystem path as a string of
characters in the conventional format.  Display it any other way (say,
as a sequence of edge-names) and you risk baffling them.

My position is (a) the convention that paths are strings really does
exist, embedded in the design and culture of the dominant operating
systems--in fact it's overwhelming, and I'm surprised anyone can miss
it; (b) there might be a reason for it, even aside from momentum.

-j
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to