On 11/26/06, Mike Orr <[EMAIL PROTECTED]> wrote: > On 11/26/06, Jim Jewett <[EMAIL PROTECTED]> wrote: > > On 11/26/06, Mike Orr <[EMAIL PROTECTED]> wrote: > > > I tried to make a separate PathAlgebra class and > > > FSPath class, but it got so unweildly to use I made > > > the latter a subclass. They're now called > > > PathName and Path.
> > This makes sense to me. An FSPath without path > > algebra is basically a "directory listing" > It's a single path, actually, Fair enough. > upon which you can call filesystem operations. > p.mkdir(), p.copytree(), p.read_file(), p.readlink(), p.listdir() So if it doesn't happen to point to a directory, you can either ask it for a different Path (the result of readlink) or open it (read_file)... > What you *can't* do is extract/alter the pathname > itself using FSPath operations. > p.ext, p + ".gz", p.expand_user() # Error! Use p.path.ext instead. I had thought that Path objects were immutable, and so these would produce new isntances. > > C: without a slash is effectively a mount point into > > the current directory. > That's what I always thought "C:foo" is. But Glyph > said it's more complicated than that: Most of the exceptions were things like the CON special file. These make the windows (or DOS) filesystem wierd, but they aren't really affected by C: vs C:\ CON, C:\dir1\CON, C:CON, and .\con all refer to the same special file. -jJ _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
