"googleboy" <[EMAIL PROTECTED]> writes: > Hi there. > > I am writing a little app tha tI would like to make cross-platform > (debian, RH, Fedora, Solaris, AIX, etc) > > Originally I decided to check what uname returned, as I didn't think it > mattered beyond the detail of Linux or SunOS etc. > > Recently I have learned that FC3 breaks my script, so I need to be > able to determine not simply "Linux" but to know exactly what unix the > script is being run on.
Anyway, checking the system name is the wrong way to build portable programs. For one thing, as you've discovered, new systems won't work properly. For another, upgrades to existing systems may break things as well. What you should do instead is check on how to use the features you want. If you watch a typical autoconf script, you'll see it groveling through libraries, include files, and various directories looking for subroutines, defines and commands. That's the idea, but without knowing which features you're looking for, I can't say how you would check for them. This takes more time to write, but results in more robust code. For instance, if some distribution changes one of the features to mimic a "better" distribution that you already support, instead of your script breaking, it'll just work. This is much better than having to teach your script how to distinguish between versions of distributions. <mike -- Mike Meyer <[EMAIL PROTECTED]> http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. -- http://mail.python.org/mailman/listinfo/python-list