Identifying an appropriate name for your rc fileSince conventions differ between platforms, here is some code to identify an appropriate name for your rc file.
# $app is presumed to be the some sort of unique identifier
# to distinguish from other rc files (such as the application name).
global env
switch $::tcl_platform(platform) "macintosh" {
set rcfile [file join $env(PREF_FOLDER) "$app Preferences"]
} "windows" {
set rcfile [file join $env(HOME) "$app.cfg"]
} "unix" {
if {[info exists env(DOTDIR)]} {
set rcfile "$env(DOTDIR)/.${app}rc"
} else {
set rcfile "$env(HOME)/.${app}rc"
}
}See also: Where to store application configuration files

