Larry Hastings wrote: > If nothing else, at least we could fix the proviso for argv[0]: "(it is > operating system dependent whether this is a full pathname or not)."
It's actually worse than that -- you're entirely at the mercy of whatever made the exec() call as to whether it's a meaningful path at all. Most programs are courteous enough to make sure it's at least a relative path to the executable being run, but you can't rely on that. I'm not sure munging argv[0] to an absolute path is the right thing to do, if it's to be regarded as a low-level thing. A program wanting low-level access to argv might want to know exactly what was passed to exec() for some reason. A separate sys.absolute_path_to_executable() or something might be better. -- Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | Carpe post meridiem! | Christchurch, New Zealand | (I'm not a morning person.) | [EMAIL PROTECTED] +--------------------------------------+ _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com