Import 'filename'? (was Re: Cross-reference 'import' in a classhierarchy)
Greg Ewing (using news.cis.dfn.de)
ckea25d02 at sneakemail.com
Fri Apr 11 02:11:58 EDT 2003
Marcus Alanen wrote:
> I'm not sure what your "good enough" algorithm actually does.
> Consider also the fact that e.g. on Linux you can mount the same
> filesystem several times, in several places.
Sure it's *possible* to do that, but I think if anyone
sets their system up in such a screwy way and it causes
them problems with importing their Python modules, they
deserve what they get.
> Personally I'd just like a simple stat() for each (non-symlink) file
> and remembering their st_dev and st_ino values. I don't know how this
> would be emulated on other operating systems, though.
That's the rub -- st_dev and st_ino are extremely Unix-
specific notions.
On classic MacOS you could use (vRefNum, fileId), I
suppose. Windows, I have no idea.
But at least they all have something akin to a symbolic
link.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
More information about the Python-list
mailing list