Dev] / as path join operator (original) (raw)
Jason Orendorff jason.orendorff at gmail.com
Mon Jan 30 19:06:16 CET 2006
- Previous message: [Python-Dev] / as path join operator
- Next message: [Python-Dev] / as path join operator
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 1/28/06, Stephen J. Turnbull <stephen at xemacs.org> 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
- Previous message: [Python-Dev] / as path join operator
- Next message: [Python-Dev] / as path join operator
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]