> Windows and Mac OS X have dedicated directories for application specific > libraries. That is ~/Library on Mac and Application Data on Windows.
In fact, I had to write code for this, and had to read the specs for each. Here's the code (I've substituted Python for UpLib): if sys.platform == 'darwin': listdir = os.path.expanduser(os.path.join("~", "Library", "Application Support", "org.python")) elif sys.platform == 'win32': if os.environ.has_key('APPDATA'): listdir = os.path.join(os.environ['APPDATA'], 'Python') elif os.environ.has_key('USERPROFILE'): listdir = os.path.join(os.environ['USERPROFILE'], 'Application Data', 'Python') elif os.environ.has_key('HOMEDIR') and os.environ.has_key('HOMEPATH'): listdir = os.path.join(os.environ['HOMEDIR'], os.environ['HOMEPATH'], 'Python') else: listdir = os.path.join(os.path.expanduser("~"), 'Python') else: # pretty much has to be unix listdir = os.path.expanduser(os.path.join("~", ".python")) _______________________________________________ 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