Version 100 of tcl_platform

Updated 2010-07-19 13:57:49 by APN

The ::tcl_platform global array holds useful data concerning the platform on which a specific Tcl interpreter is running. This page is intended to list the values of tcl_platform on various systems. This might be useful for folks who are trying to adapt their code to different platforms.

The meaning of the element names are:

  • byteOrder - is the most significant, or least significant, byte first
  • machine - some info specific to the kind of hardware
  • os - a string identifying the operating system
  • osVersion - the version of the os
  • platform - which of the major types of computers is this
  • user - user's login id
  • wordSize - number of bytes for a machine-word
  • pointerSize - bytes taken up by a void pointer (from 8.5)
  • pathSeparator — character used to split variables like env(PATH) into a proper Tcl list (from 8.6)

Optionally present members include:

  • threaded - tcl configured with --enable-threads
  • debug - a windows tcl configured with --enable-debug

Is anyone aware of any other members?


LV In Tcl 8.5, a new platform package makes available new commands such as platform::generic and platform::identify .


LV How much of this information is generated dynamically, and how much of it really is generated statically at compile time?

  • byteOrder, wordSize, and pointerSize are dynamically generated.
  • The statement which adds the threaded element is statically compiled into the system.
  • The platform entry is generated statically.
  • The os, and osVersion entries appear to be generated dynamically.
  • The machine entry is generated dynamically.
  • The user entry is generated dynamically (based on USER and LOGNAME environment variables)
  • The debug entry is statically added.

Please add the output of

  parray tcl_platform

here for your platform if it is not represented.

MSDN has documentation for the Microsoft Windows platforms [L1 ] (RS: found that link stale, as msdn-usual...)

What order should these be in? Alpha by platform? -- CLN

I've put the Linux entries together, annotated with processor, kernel, and distribution info. -- DJH

AIX 4.3:

 tcl_platform(byteOrder) = bigEndian
 tcl_platform(machine)   = 003C87964C00
 tcl_platform(os)        = AIX
 tcl_platform(osVersion) = 4.3
 tcl_platform(platform)  = unix
 tcl_platform(user)      = nelson

AIX 5.1 on PPC:

 tcl_platform(byteOrder) = bigEndian
 tcl_platform(machine)   = 0042065B4C00
 tcl_platform(os)        = AIX
 tcl_platform(osVersion) = 5.1
 tcl_platform(platform)  = unix
 tcl_platform(user)      = stevel
 tcl_platform(wordSize)  = 4

AIX 6.1 on pSeries:

  tcl_platform(byteOrder) = bigEndian
  tcl_platform(machine)   = 000BF680D600
  tcl_platform(os)        = AIX
  tcl_platform(osVersion) = 6.1
  tcl_platform(platform)  = unix
  tcl_platform(user)      = makr
  tcl_platform(wordSize)  = 4

CYGWIN_NT-5.1 (cygtclsh80, Cygwin on Windows XP Professional):

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = intel
 tcl_platform(os)        = Windows NT
 tcl_platform(osVersion) = 5.1
 tcl_platform(platform)  = windows

HP-UX 10.20:

 tcl_platform(byteOrder) = bigEndian
 tcl_platform(machine)   = 9000/715
 tcl_platform(os)        = HP-UX
 tcl_platform(osVersion) = B.10.20
 tcl_platform(platform)  = unix
 tcl_platform(user)      = nelson

HP-UX 11:

 tcl_platform(byteOrder) = bigEndian
 tcl_platform(machine)   = 9000/782
 tcl_platform(os)        = HP-UX
 tcl_platform(osVersion) = B.11.00
 tcl_platform(platform)  = unix
 tcl_platform(user)      = nelson

HP-UX 11.11:

  tcl_platform(byteOrder) = bigEndian
  tcl_platform(machine)   = 9000/800
  tcl_platform(os)        = HP-UX
  tcl_platform(osVersion) = B.11.11
  tcl_platform(platform)  = unix
  tcl_platform(user)      = makr
  tcl_platform(wordSize)  = 4

HP-UX 11.23 Itanium :

  tcl_platform(byteOrder) = bigEndian
  tcl_platform(machine)   = ia64
  tcl_platform(os)        = HP-UX
  tcl_platform(osVersion) = B.11.23
  tcl_platform(platform)  = unix
  tcl_platform(wordSize)  = 4

HP-UX 11.31 parisc :

  tcl_platform(byteOrder) = bigEndian
  tcl_platform(machine)   = 9000/800
  tcl_platform(os)        = HP-UX
  tcl_platform(osVersion) = B.11.31
  tcl_platform(platform)  = unix
  tcl_platform(user)      = makr
  tcl_platform(wordSize)  = 4

IRIX 6.5:

 tcl_platform(byteOrder) = bigEndian
 tcl_platform(machine)   = IP32
 tcl_platform(os)        = IRIX
 tcl_platform(osVersion) = 6.5
 tcl_platform(platform)  = unix

Linux Alpha kernel 2.2, distrib Redhat 6.2:

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = alpha
 tcl_platform(os)        = Linux
 tcl_platform(osVersion) = 2.2.19
 tcl_platform(platform)  = unix
 tcl_platform(user)      = dgp

Linux StrongARM kernel 2.4, distrib Debian 2.2

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = armv4l
 tcl_platform(os)        = Linux
 tcl_platform(osVersion) = 2.4.0-test1-ac7-rmk1-crl2
 tcl_platform(platform)  = unix
 tcl_platform(user)      = guest
 tcl_platform(wordSize)  = 4

Linux PowerPC kernel 2.4, distrib Debian 'woody':

 tcl_platform(byteOrder) = bigEndian
 tcl_platform(machine)   = ppc
 tcl_platform(os)        = Linux
 tcl_platform(osVersion) = 2.4.16
 tcl_platform(platform)  = unix
 tcl_platform(user)      = davidw

Linux s/390x kernel 2.6, distrib SuSE Enterprise Server 10 SP 1:

  tcl_platform(byteOrder) = bigEndian
  tcl_platform(machine)   = s390x
  tcl_platform(os)        = Linux
  tcl_platform(osVersion) = 2.6.16.46-0.12-default
  tcl_platform(platform)  = unix
  tcl_platform(user)      = makr
  tcl_platform(wordSize)  = 4

Linux SH4 kernel 2.4, distrib Debian unstable/testing:

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = sh4
 tcl_platform(os)        = Linux
 tcl_platform(osVersion) = 2.4.18-sh
 tcl_platform(platform)  = unix
 tcl_platform(user)      = davidw
 tcl_platform(wordSize)  = 4

Linux x86 kernel 2.4, distrib RedHat Enterprise Linux 3:

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = ia64
 tcl_platform(os)        = Linux
 tcl_platform(osVersion) = 2.4.21-47.EL
 tcl_platform(platform)  = unix
 tcl_platform(wordSize)  = 8

Linux x86 kernel 2.2, distrib Redhat 6.2:

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = i686
 tcl_platform(os)        = Linux
 tcl_platform(osVersion) = 2.2.19
 tcl_platform(platform)  = unix
 tcl_platform(user)      = dhagberg

Linux x86 kernel 2.4, distrib Debian:

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = i686
 tcl_platform(os)        = Linux
 tcl_platform(osVersion) = 2.4.7-win4lin
 tcl_platform(platform)  = unix 
 tcl_platform(user)      = steve

Linux x86 kernel 2.4 distrib Mandrake (8.1)

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = i686
 tcl_platform(os)        = Linux
 tcl_platform(osVersion) = 2.4.8-26mdk
 tcl_platform(platform)  = unix
 tcl_platform(user)      = bnl

Linux x86, kernel 2.4.22, distrib Slackware

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = i686
 tcl_platform(os)        = Linux
 tcl_platform(osVersion) = 2.4.22
 tcl_platform(platform)  = unix
 tcl_platform(wordSize)  = 4

Linux x86, kernel 2.6.8, distrib Debian, Sarge (on PC with 1GHz AMD Athlon)

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = i686
 tcl_platform(os)        = Linux
 tcl_platform(osVersion) = 2.6.8-2-386
 tcl_platform(platform)  = unix
 tcl_platform(threaded)  = 1
 tcl_platform(user)      = mark
 tcl_platform(wordSize)  = 4

Linux x86, kernel 2.6.8, distrib Debian, Sarge (on PC with a classic Pentium 120)

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = i586
 tcl_platform(os)        = Linux
 tcl_platform(osVersion) = 2.6.8-2-386
 tcl_platform(platform)  = unix
 tcl_platform(threaded)  = 1
 tcl_platform(user)      = mark
 tcl_platform(wordSize)  = 4

Linux x86_64, kernel 2.6.8, distrib SUSE 9.2

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = x86_64
 tcl_platform(os)        = Linux
 tcl_platform(osVersion) = 2.6.8-24.14-default
 tcl_platform(platform)  = unix
 tcl_platform(user)      = chuckf
 tcl_platform(wordSize)  = 8

Linux x86, kernel 2.6.21.5, distrib Slackware 12.0

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = i686
 tcl_platform(os)        = Linux
 tcl_platform(osVersion) = 2.6.21.5
 tcl_platform(platform)  = unix
 tcl_platform(tip,268)   = 1
 tcl_platform(tip,280)   = 1
 tcl_platform(user)      = boogie
 tcl_platform(wordSize)  = 4

Mac OS 8:

 tcl_platform(byteOrder) = bigEndian
 tcl_platform(machine)   = ppc
 tcl_platform(os)        = MacOS
 tcl_platform(osVersion) = 8.6
 tcl_platform(platform)  = macintosh
 tcl_platform(user)      = Jim Easterbrook

Mac OS 9:

 tcl_platform(byteOrder) = bigEndian
 tcl_platform(machine)   = ppc
 tcl_platform(os)        = MacOS
 tcl_platform(osVersion) = 9.0
 tcl_platform(platform)  = macintosh
 tcl_platform(user)      = mschindler

Mac OS X:

 tcl_platform(byteOrder) = bigEndian
 tcl_platform(machine)   = Power Macintosh
 tcl_platform(os)        = Darwin
 tcl_platform(osVersion) = 1.3.7
 tcl_platform(platform)  = unix
 tcl_platform(user)      = mike

Mac OS X, officially version 10.2.3, "Jaguar":

 tcl_platform(byteOrder) = bigEndian
 tcl_platform(machine)   = Power Macintosh
 tcl_platform(os)        = Darwin
 tcl_platform(osVersion) = 6.3
 tcl_platform(platform)  = unix
 tcl_platform(user)      = benny

Mac OS X, 10.3.9, "Panther"

 tcl_platform(byteOrder) = bigEndian
 tcl_platform(machine)   = Power Macintosh
 tcl_platform(os)        = Darwin
 tcl_platform(osVersion) = 7.9.0
 tcl_platform(platform)  = unix
 tcl_platform(threaded)  = 1
 tcl_platform(user)      = robert
 tcl_platform(wordSize)  = 4

Mac OS X, 10.4.1, "Tiger"

 tcl_platform(byteOrder) = bigEndian
 tcl_platform(machine)   = Power Macintosh
 tcl_platform(os)        = Darwin
 tcl_platform(osVersion) = 8.1.0
 tcl_platform(platform)  = unix
 tcl_platform(threaded)  = 1
 tcl_platform(user)      = robert
 tcl_platform(wordSize)  = 4

Mac OS X, 10.4.3, "Tiger"

 tcl_platform(byteOrder) = bigEndian
 tcl_platform(machine)   = Power Macintosh
 tcl_platform(os)        = Darwin
 tcl_platform(osVersion) = 8.3.0
 tcl_platform(platform)  = unix
 tcl_platform(threaded)  = 1
 tcl_platform(wordSize)  = 4

Mac OS X, 10.4.6

 tcl_platform(byteOrder) = bigEndian
 tcl_platform(machine)   = Power Macintosh
 tcl_platform(os)        = Darwin
 tcl_platform(osVersion) = 8.6.0
 tcl_platform(platform)  = unix
 tcl_platform(threaded)  = 1
 tcl_platform(user)      = paul
 tcl_platform(wordSize)  = 4

Mac OS X, 10.4.8 (PowerPC)

 tcl_platform(byteOrder) = bigEndian
 tcl_platform(machine)   = Power Macintosh
 tcl_platform(os)        = Darwin
 tcl_platform(osVersion) = 8.8.0
 tcl_platform(platform)  = unix
 tcl_platform(threaded)  = 1
 tcl_platform(user)      = mks
 tcl_platform(wordSize)  = 4

Mac OS X, 10.4.8 (Intel)

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = i386
 tcl_platform(os)        = Darwin
 tcl_platform(osVersion) = 8.8.1
 tcl_platform(platform)  = unix
 tcl_platform(threaded)  = 1
 tcl_platform(user)      = mks
 tcl_platform(wordSize)  = 4

Mac OS X, 10.4.10 (Intel)

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = i386
 tcl_platform(os)        = Darwin
 tcl_platform(osVersion) = 8.10.1
 tcl_platform(platform)  = unix
 tcl_platform(threaded)  = 1
 tcl_platform(tip,268)   = 1
 tcl_platform(tip,280)   = 1
 tcl_platform(user)      = robert
 tcl_platform(wordSize)  = 4

Mac OS X, 10.5.1 "Leopard" (PowerPC)

 tcl_platform(byteOrder) = bigEndian
 tcl_platform(machine)   = Power Macintosh
 tcl_platform(os)        = Darwin
 tcl_platform(osVersion) = 9.1.0
 tcl_platform(platform)  = unix
 tcl_platform(wordSize)  = 8

Mac OS X, 10.5.1 "Leopard" (Intel) - ActiveTcl 8.5.0

 tcl_platform(byteOrder)   = littleEndian
 tcl_platform(machine)     = i386
 tcl_platform(os)          = Darwin
 tcl_platform(osVersion)   = 9.1.0
 tcl_platform(platform)    = unix
 tcl_platform(pointerSize) = 4
 tcl_platform(threaded)    = 1
 tcl_platform(wordSize)    = 4

MacOS X 10.6.2 "Snow Leopard" (Intel) - ActiveTcl 8.6

 tcl_platform(byteOrder)   = littleEndian
 tcl_platform(machine)     = i386
 tcl_platform(os)          = Darwin
 tcl_platform(osVersion)   = 10.2.0
 tcl_platform(platform)    = unix
 tcl_platform(pointerSize) = 4
 tcl_platform(threaded)    = 1
 tcl_platform(wordSize)    = 4

DragonFlyBSD 1.0A-RELEASE

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = i386
 tcl_platform(os)        = DragonFly
 tcl_platform(osVersion) = 1.0A-RELEASE
 tcl_platform(platform)  = unix
 tcl_platform(threaded)  = 1
 tcl_platform(user)      = julz
 tcl_platform(wordSize)  = 4

FreeBSD 4.7-STABLE x86:

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = i386
 tcl_platform(os)        = FreeBSD
 tcl_platform(osVersion) = 4.7-STABLE
 tcl_platform(platform)  = unix
 tcl_platform(user)      = phantom
 tcl_platform(wordSize)  = 4

FreeBSD 4.8-STABLE x86:

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = i386
 tcl_platform(os)        = FreeBSD
 tcl_platform(osVersion) = 4.8-STABLE
 tcl_platform(platform)  = unix
 tcl_platform(user)      = phantom
 tcl_platform(wordSize)  = 4

NetBSD 1.6(I) x86:

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = i386
 tcl_platform(os)        = NetBSD
 tcl_platform(osVersion) = 1.6I
 tcl_platform(platform)  = unix
 tcl_platform(user)      = phaeton

NetBSD 2.0.2 x86:

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = i386
 tcl_platform(os)        = NetBSD
 tcl_platform(osVersion) = 2.0.2
 tcl_platform(platform)  = unix
 tcl_platform(user)      = gps
 tcl_platform(wordSize)  = 4

OpenBSD 3.0 x86:

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = i386
 tcl_platform(os)        = OpenBSD
 tcl_platform(osVersion) = 3.0
 tcl_platform(platform)  = unix
 tcl_platform(user)      = gps
 tcl_platform(wordSize)  = 4

SunOS 4:

 tcl_platform(byteOrder) = bigEndian
 tcl_platform(machine)   = sun4m
 tcl_platform(os)        = SunOS
 tcl_platform(osVersion) = 4.1.3_U1
 tcl_platform(platform)  = unix

SPARC Solaris 2.6:

 tcl_platform(byteOrder) = bigEndian
 tcl_platform(machine)   = sun4u
 tcl_platform(os)        = SunOS
 tcl_platform(osVersion) = 5.6
 tcl_platform(platform)  = unix
 tcl_platform(user)      = lwv26

Sparc Solaris 2.7:

 tcl_platform(byteOrder) = bigEndian
 tcl_platform(machine)   = sun4u
 tcl_platform(os)        = SunOS
 tcl_platform(osVersion) = 5.7
 tcl_platform(platform)  = unix
 tcl_platform(threaded)  = 1
 tcl_platform(user)      = hboeken

Sparc Solaris 8:

 tcl_platform(byteOrder) = bigEndian
 tcl_platform(machine)   = sun4u
 tcl_platform(os)        = SunOS
 tcl_platform(osVersion) = 5.8
 tcl_platform(platform)  = unix
 tcl_platform(user)      = rcasey

Intel Solaris 8:

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = i86pc
 tcl_platform(os)        = SunOS
 tcl_platform(osVersion) = 5.8
 tcl_platform(platform)  = unix
 tcl_platform(user)      = daniel
 tcl_platform(wordSize)  = 4

Sparc Solaris 9 with threads enabled:

 tcl_platform(byteOrder) = bigEndian
 tcl_platform(machine)   = sun4u
 tcl_platform(os)        = SunOS
 tcl_platform(osVersion) = 5.9
 tcl_platform(platform)  = unix
 tcl_platform(threaded)  = 1
 tcl_platform(user)      = lwv26
 tcl_platform(wordSize)  = 4

Sparc Solaris 9 with threads and 64 bit enabled:

 tcl_platform(byteOrder) = bigEndian
 tcl_platform(machine)   = sun4u
 tcl_platform(os)        = SunOS
 tcl_platform(osVersion) = 5.9
 tcl_platform(platform)  = unix
 tcl_platform(pointerSize)  = 8
 tcl_platform(threaded)  = 1
 tcl_platform(user)      = lwv26
 tcl_platform(wordSize)  = 8

Sparc Solaris 9, without threads or 64 bit enabled, Tcl 8.5.4:

 tcl_platform(byteOrder)   = bigEndian
 tcl_platform(machine)     = sun4u
 tcl_platform(os)          = SunOS
 tcl_platform(osVersion)   = 5.9
 tcl_platform(platform)    = unix
 tcl_platform(pointerSize) = 4
 tcl_platform(user)        = lwv27
 tcl_platform(wordSize)    = 4

Sparc Solaris 10:

 tcl_platform(byteOrder) = bigEndian
 tcl_platform(machine)   = sun4u
 tcl_platform(os)        = SunOS
 tcl_platform(osVersion) = 5.10
 tcl_platform(platform)  = unix
 tcl_platform(user)      = idy
 tcl_platform(wordSize)  = 4

S/390 Linux

 tcl_platform(byteOrder) = bigEndian
 tcl_platform(machine)   = s390
 tcl_platform(os)        = Linux
 tcl_platform(osVersion) = 2.4.21-20.EL
 tcl_platform(platform)  = unix
 tcl_platform(user)      = root
 tcl_platform(wordSize)  = 4

Tru64 UNIX:

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = alpha
 tcl_platform(os)        = OSF1
 tcl_platform(osVersion) = X5.1
 tcl_platform(platform)  = unix

Windows 3.1:

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = intel
 tcl_platform(os)        = Win32s
 tcl_platform(osVersion) = 1.30
 tcl_platform(platform)  = windows

Win95:

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = intel
 tcl_platform(os)        = Windows 95
 tcl_platform(osVersion) = 4.0
 tcl_platform(platform)  = windows
 tcl_platform(user)      = suchenwi
 tcl_platform(wordSize)  = 4

Win98:

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = intel
 tcl_platform(os)        = Windows 95
 tcl_platform(osVersion) = 4.10
 tcl_platform(platform)  = windows
 tcl_platform(user)      = Peter Lewerin

WinNT:

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = intel
 tcl_platform(os)        = Windows NT
 tcl_platform(osVersion) = 4.0
 tcl_platform(platform)  = windows
 tcl_platform(user)      = easter

Win2000:

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = intel
 tcl_platform(os)        = Windows NT
 tcl_platform(osVersion) = 5.0
 tcl_platform(platform)  = windows
 tcl_platform(user)      = user
 tcl_platform(wordSize)  = 4

Windows XP Home:

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = intel
 tcl_platform(os)        = Windows NT
 tcl_platform(osVersion) = 5.1
 tcl_platform(platform)  = windows
 tcl_platform(user)      = George Staplin
 tcl_platform(wordSize)  = 4

Windows XP Professional:

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(debug)     = 1
 tcl_platform(machine)   = intel
 tcl_platform(os)        = Windows NT
 tcl_platform(osVersion) = 5.1
 tcl_platform(platform)  = windows
 tcl_platform(user)      = George

Windows XP Professional/Firefox 1.04 with Tcl/Tk Tclet Plugin (with [tk windowingsystem] = "win32"):

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(platform)  = windows
 tcl_platform(wordSize)  = 4

Windows Vista:

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = intel
 tcl_platform(os)        = Windows NT
 tcl_platform(osVersion) = 6.0
 tcl_platform(platform)  = windows
 tcl_platform(user)      = pat
 tcl_platform(wordSize)  = 4

Windows 2003 x64 (64-bit) running 32-bit Tcl:

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = intel
 tcl_platform(os)        = Windows NT
 tcl_platform(osVersion) = 5.2
 tcl_platform(platform)  = windows
 tcl_platform(user)      = jeffh
 tcl_platform(wordSize)  = 4

Windows 2003 x64 (64-bit) running 64-bit Tcl:

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = amd64
 tcl_platform(os)        = Windows NT
 tcl_platform(osVersion) = 5.2
 tcl_platform(platform)  = windows
 tcl_platform(user)      = jeffh
 tcl_platform(wordSize)  = 4

Windows 7 x86 (pre-release version):

 tcl_platform(byteOrder)   = littleEndian
 tcl_platform(machine)     = intel
 tcl_platform(os)          = Windows NT
 tcl_platform(osVersion)   = 6.1
 tcl_platform(pointerSize) = 4
 tcl_platform(user)        = pat
 tcl_platform(wordSize)    = 4

Windows 7 Home Premium 64-bit

 tcl_platform(byteOrder)   = littleEndian
 tcl_platform(machine)     = intel
 tcl_platform(os)          = Windows NT
 tcl_platform(osVersion)   = 6.1
 tcl_platform(platform)    = windows
 tcl_platform(pointerSize) = 4
 tcl_platform(threaded)    = 1
 tcl_platform(user)        = keith
 tcl_platform(wordSize)    = 4

Windows 2008 Server R2 64-bit

 tcl_platform(byteOrder)     = littleEndian
 tcl_platform(machine)       = amd64
 tcl_platform(os)            = Windows NT
 tcl_platform(osVersion)     = 6.1
 tcl_platform(pathSeparator) = ;
 tcl_platform(platform)      = windows
 tcl_platform(pointerSize)   = 8
 tcl_platform(threaded)      = 1
 tcl_platform(user)          = Administrator
 tcl_platform(wordSize)      = 4

Windows/CE:

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = arm
 tcl_platform(os)        = Windows CE
 tcl_platform(osVersion) = 3.0
 tcl_platform(platform)  = windows
 tcl_platform(user)      = 

Windows Mobile 2003SE (eTcl):

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = arm
 tcl_platform(os)        = Windows CE
 tcl_platform(osVersion) = 4.21
 tcl_platform(platform)  = windows
 tcl_platform(threaded)  = 1
 tcl_platform(user)      = nobody
 tcl_platform(wordSize)  = 4

OS/400 V5R1M0:

 tcl_platform(byteOrder)     = bigEndian
 tcl_platform(host_platform) = unix     
 tcl_platform(machine)       = PowerPC  
 tcl_platform(os)            = OS/400   
 tcl_platform(osVersion)     = V5R1M0   
 tcl_platform(platform)      = java     

QNX 6.3.0

 tcl_platform(byteOrder) = littleEndian
 tcl_platform(machine)   = x86pc
 tcl_platform(os)        = QNX
 tcl_platform(osVersion) = 6.3.0
 tcl_platform(platform)  = unix

Usage tip: it's probably a mistake to "switch $::tcl_platform(os) ..." If you're having to distinguish different flavors of Unix or Windows from each other, you're likely better off determining the availability of the functionality you truly want, rather than trying to infer it from OS variation. In the Microsoft world, for example, service packs give different NT installations features that align them with 95, 98, ... Think of how autoconf performs run-time tests, rather than switching on uname.

For Tk since 8.4.2 there is also [tk windowingsystem], which tells you whether your Tk port is "win32", "x11", "aqua" or (MacOS) "classic". For UI issues that's better than asking for $tcl_platform(platform) and/or $tcl_platform(os), especially on MacOS X, where you have "aqua" as well as "x11" on the very same platform.


Note, the debug variable apparently is only available on Windows platforms when the Tcl library itself was compiled with the --enable-symbols flag.


There's a separate page called Generating a generic platform name, for discussion on how to massage the above information into a name which can be used as dirname to disambiguate shared libraries, etc.


Also potentially useful is the getWindowsAPIVendor proc which, on Windows, provides info regarding whether your underlying platform is Microsoft Windows, Wine or ReactOS.



daneyul - 2010-03-18 15:37:42

Last I checked, Windows 7 is no longer pre-release. Any one have any info on the codes returned by Win 7 32, 64, for the different versions (Home Premium, Ultimate, Pro) for those who don't have Win 7 systems at hand?