Following values can be passed as parameter:
“byteOrder” , “debug”, “machine”, “os”, “osVersion”, “platform”, “threaded”, “user”, “wordSize”, “pointerSize”.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
proc fnGetPlatformInfo { key args} {
upvar tcl_platform tcl_platform
set kee $key
if [ catch {
foreach {key value} [array get tcl_platform] {
if {$key == $kee} {
return $value
}
}
} err ] {
return $err
}
return $value
}
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Usage Sample:
#To get process user:
set user [fnGetPlatformInfo “user”]
puts “Process executing by user: $user”
#To get Operating system:
set oS [fnGetPlatformInfo “os”]
puts “Operating System: $oS”
#To get Operating System version:
set oSv [fnGetPlatformInfo “osVersion”]
puts “Operating System version: $oSv”