The ::tcl_platform global array (documented on the tclvars manpage) 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:
Optionally present members include:
Eagle may provide the following members (other implementations may support some of these as well):
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?
Please add the output of
parray tcl_platform
here for your platform if it is not represented.
AIXtcl_platform(byteOrder) = bigEndian tcl_platform(machine) = 003C87964C00 tcl_platform(os) = AIX tcl_platform(osVersion) = 4.3 tcl_platform(platform) = unix
tcl_platform(byteOrder) = bigEndian tcl_platform(machine) = 0042065B4C00 tcl_platform(os) = AIX tcl_platform(osVersion) = 5.1 tcl_platform(platform) = unix tcl_platform(wordSize) = 4
tcl_platform(byteOrder) = bigEndian tcl_platform(machine) = 000BF680D600 tcl_platform(os) = AIX tcl_platform(osVersion) = 6.1 tcl_platform(platform) = unix tcl_platform(wordSize) = 4
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = armv7l tcl_platform(os) = Linux tcl_platform(osVersion) = 3.0.36+ tcl_platform(pathSeparator) = : tcl_platform(platform) = unix tcl_platform(pointerSize) = 4 tcl_platform(threaded) = 1 tcl_platform(user) = u0_a71 tcl_platform(wordSize) = 4
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = armv7l tcl_platform(os) = Linux tcl_platform(osVersion) = 3.4.0 tcl_platform(pathSeparator) = : tcl_platform(platform) = unix tcl_platform(pointerSize) = 4 tcl_platform(threaded) = 1 tcl_platform(user) = u0_a107 tcl_platform(wordSize) = 4
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = armv7l tcl_platform(os) = Linux tcl_platform(osVersion) = 3.4.0-perf-g5fe8ba4 tcl_platform(pathSeparator) = : tcl_platform(platform) = unix tcl_platform(pointerSize) = 4 tcl_platform(threaded) = 1 tcl_platform(user) = u0_a3 tcl_platform(wordSize) = 4
User names are assigned automatically by the OS.
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(byteOrder) = bigEndian tcl_platform(machine) = 9000/782 tcl_platform(os) = HP-UX tcl_platform(osVersion) = B.11.00 tcl_platform(platform) = unix
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(wordSize) = 4
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
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(wordSize) = 4
I've put the Linux entries together, annotated with processor, kernel, and distribution info. -- DJH
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = alpha tcl_platform(os) = Linux tcl_platform(osVersion) = 2.2.19 tcl_platform(platform) = unix
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(wordSize) = 4
tcl_platform(byteOrder) = bigEndian tcl_platform(machine) = ppc tcl_platform(os) = Linux tcl_platform(osVersion) = 2.4.16 tcl_platform(platform) = unix
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(wordSize) = 4
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(wordSize) = 4
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
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = i686 tcl_platform(os) = Linux tcl_platform(osVersion) = 2.2.19 tcl_platform(platform) = unix
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(byteOrder) = littleEndian tcl_platform(machine) = i686 tcl_platform(os) = Linux tcl_platform(osVersion) = 2.4.8-26mdk tcl_platform(platform) = unix
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
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(wordSize) = 4
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(wordSize) = 4
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(wordSize) = 8
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(wordSize) = 4
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(wordSize) = 4
tcl_platform(byteOrder) = bigEndian tcl_platform(machine) = ppc tcl_platform(os) = MacOS tcl_platform(osVersion) = 8.6 tcl_platform(platform) = macintosh
tcl_platform(byteOrder) = bigEndian tcl_platform(machine) = ppc tcl_platform(os) = MacOS tcl_platform(osVersion) = 9.0 tcl_platform(platform) = macintosh
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(byteOrder) = bigEndian tcl_platform(machine) = Power Macintosh tcl_platform(os) = Darwin tcl_platform(osVersion) = 6.3 tcl_platform(platform) = unix
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(wordSize) = 4
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(wordSize) = 4
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
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(wordSize) = 4
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(wordSize) = 4
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(wordSize) = 4
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(wordSize) = 4
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
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
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
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = x86_64 tcl_platform(os) = Darwin tcl_platform(osVersion) = 11.1.0 tcl_platform(platform) = unix tcl_platform(pointerSize) = 8 tcl_platform(threaded) = 1 tcl_platform(wordSize) = 8
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = x86_64 tcl_platform(os) = Darwin tcl_platform(osVersion) = 13.3.0 tcl_platform(pathSeparator) = : tcl_platform(platform) = unix tcl_platform(pointerSize) = 8 tcl_platform(threaded) = 1 tcl_platform(wordSize) = 8
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = x86_64 tcl_platform(os) = Darwin tcl_platform(osVersion) = 14.3.0 tcl_platform(pathSeparator) = : tcl_platform(platform) = unix tcl_platform(pointerSize) = 8 tcl_platform(threaded) = 1 tcl_platform(wordSize) = 8
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = x86_64 tcl_platform(os) = Darwin tcl_platform(osVersion) = 15.3.0 tcl_platform(pathSeparator) = : tcl_platform(platform) = unix tcl_platform(pointerSize) = 8 tcl_platform(threaded) = 1 tcl_platform(wordSize) = 8
tcl_platform(byteOrder) = littleEndian tcl_platform(engine) = Tcl tcl_platform(machine) = x86_64 tcl_platform(os) = Darwin tcl_platform(osVersion) = 16.3.0 tcl_platform(pathSeparator) = : tcl_platform(platform) = unix tcl_platform(pointerSize) = 8 tcl_platform(threaded) = 1 tcl_platform(wordSize) = 8
tcl_platform(byteOrder) = littleEndian tcl_platform(engine) = Tcl tcl_platform(machine) = x86_64 tcl_platform(os) = Darwin tcl_platform(osVersion) = 21.6.0 tcl_platform(pathSeparator) = : tcl_platform(platform) = unix tcl_platform(pointerSize) = 8 tcl_platform(threaded) = 1 tcl_platform(wordSize) = 8
tcl_platform(byteOrder) = littleEndian tcl_platform(engine) = Tcl tcl_platform(machine) = arm64 tcl_platform(os) = Darwin tcl_platform(osVersion) = 22.6.0 tcl_platform(pathSeparator) = : tcl_platform(platform) = unix tcl_platform(pointerSize) = 8 tcl_platform(threaded) = 1 tcl_platform(wordSize) = 8
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(wordSize) = 4
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = i386 tcl_platform(os) = FreeBSD tcl_platform(osVersion) = 4.7-STABLE tcl_platform(platform) = unix tcl_platform(wordSize) = 4
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = i386 tcl_platform(os) = FreeBSD tcl_platform(osVersion) = 4.8-STABLE tcl_platform(platform) = unix tcl_platform(wordSize) = 4
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = i386 tcl_platform(os) = NetBSD tcl_platform(osVersion) = 1.6I tcl_platform(platform) = unix
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = i386 tcl_platform(os) = NetBSD tcl_platform(osVersion) = 2.0.2 tcl_platform(platform) = unix tcl_platform(wordSize) = 4
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = i386 tcl_platform(os) = OpenBSD tcl_platform(osVersion) = 3.0 tcl_platform(platform) = unix tcl_platform(wordSize) = 4
tcl_platform(byteOrder) = bigEndian tcl_platform(machine) = sun4m tcl_platform(os) = SunOS tcl_platform(osVersion) = 4.1.3_U1 tcl_platform(platform) = unix
tcl_platform(byteOrder) = bigEndian tcl_platform(machine) = sun4u tcl_platform(os) = SunOS tcl_platform(osVersion) = 5.6 tcl_platform(platform) = unix
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(byteOrder) = bigEndian tcl_platform(machine) = sun4u tcl_platform(os) = SunOS tcl_platform(osVersion) = 5.8 tcl_platform(platform) = unix
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = i86pc tcl_platform(os) = SunOS tcl_platform(osVersion) = 5.8 tcl_platform(platform) = unix tcl_platform(wordSize) = 4
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(wordSize) = 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) = 8 tcl_platform(threaded) = 1 tcl_platform(wordSize) = 8
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(wordSize) = 4
tcl_platform(byteOrder) = bigEndian tcl_platform(machine) = sun4u tcl_platform(os) = SunOS tcl_platform(osVersion) = 5.10 tcl_platform(platform) = unix tcl_platform(wordSize) = 4
tcl_platform(byteOrder) = bigEndian tcl_platform(machine) = sun4u tcl_platform(os) = SunOS tcl_platform(osVersion) = 5.10 tcl_platform(platform) = unix tcl_platform(pointerSize) = 8 tcl_platform(wordSize) = 8
tcl_platform(byteOrder) = bigEndian tcl_platform(machine) = sun4u tcl_platform(os) = SunOS tcl_platform(osVersion) = 5.10 tcl_platform(platform) = unix tcl_platform(pointerSize) = 4 tcl_platform(wordSize) = 4
tcl_platform(byteOrder) = bigEndian tcl_platform(machine) = IP32 tcl_platform(os) = IRIX tcl_platform(osVersion) = 6.5 tcl_platform(platform) = unix
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = alpha tcl_platform(os) = OSF1 tcl_platform(osVersion) = X5.1 tcl_platform(platform) = unix
MSDN has documentation for the Microsoft Windows platforms [L1 ]
tcl_platform(byteOrder) = littleEndian tcl_platform(engine) = Tcl tcl_platform(machine) = x86_64 tcl_platform(os) = MINGW64_NT-10.0-19045 tcl_platform(osVersion) = 3.4.8.x86_64 tcl_platform(pathSeparator) = : tcl_platform(platform) = unix tcl_platform(pointerSize) = 8 tcl_platform(threaded) = 1 tcl_platform(user) = someone tcl_platform(wordSize) = 8
Like the old cygwin example below - this is showing platform = unix on a windows machine.
The above is for a shell launched using something like one of the following:
msys2 -ucrt64 ucrt64 msys2 -mingw64 mingw64
for a shell launched as plain msys2 the reported os may differ:
msys2 tcl_platform(os) = MSYS_NT-10.0-19045
mingw32 reports as:
tcl_platform(os) = MINGW32_NT-10.0-19045
The reporting of platform=unix doessn't happen with all tcl packages installed under msys2/mingw for example the /ucrt64/bin/tclsh below shows platform = windows
The base msys/tcl has been specifically patched to remove the standard CYGWIN detection and produce a binary that runs on windows but with unix-like behaviour for running within MSYS2. It is patched in multiple places, a sample follows:
-#ifdef __CYGWIN__ +#if 0
If you build your own Tcl/Tk binaries using msys2 they will not come out as platform=unix unless you do the same sort of patching - which presumably you would only do if you wanted a binary that is specifically to run under msys2 shells and integrate with the other unix-like tools it provides.
Note that your tcl::tm::list paths may come out wonky if you use the TCL9_0_TM_PATH environment variable (or as applicable to your version)
This is because it is picking up your windows style paths in a Tcl build that is running as platform=unix and splitting the value on :
see also: TCLLIBPATH
tcl_platform(byteOrder) = littleEndian tcl_platform(engine) = Tcl tcl_platform(machine) = amd64 tcl_platform(os) = Windows NT tcl_platform(osVersion) = 10.0 tcl_platform(pathSeparator) = ; tcl_platform(platform) = windows tcl_platform(pointerSize) = 8 tcl_platform(threaded) = 1 tcl_platform(user) = someone tcl_platform(wordSize) = 4
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = intel tcl_platform(os) = Windows NT tcl_platform(osVersion) = 5.1 tcl_platform(platform) = unix
The last field changed from "windows" to "unix" in 2012-02.
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = intel tcl_platform(os) = Win32s tcl_platform(osVersion) = 1.30 tcl_platform(platform) = windows
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = intel tcl_platform(os) = Windows 95 tcl_platform(osVersion) = 4.0 tcl_platform(platform) = windows tcl_platform(wordSize) = 4
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = intel tcl_platform(os) = Windows 95 tcl_platform(osVersion) = 4.10 tcl_platform(platform) = windows
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = intel tcl_platform(os) = Windows NT tcl_platform(osVersion) = 4.0 tcl_platform(platform) = windows
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = intel tcl_platform(os) = Windows NT tcl_platform(osVersion) = 5.0 tcl_platform(platform) = windows tcl_platform(wordSize) = 4
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = intel tcl_platform(os) = Windows NT tcl_platform(osVersion) = 5.1 tcl_platform(platform) = windows tcl_platform(wordSize) = 4
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(byteOrder) = littleEndian tcl_platform(platform) = windows tcl_platform(wordSize) = 4
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = intel tcl_platform(os) = Windows NT tcl_platform(osVersion) = 5.2 tcl_platform(platform) = windows tcl_platform(wordSize) = 4
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = amd64 tcl_platform(os) = Windows NT tcl_platform(osVersion) = 5.2 tcl_platform(platform) = windows tcl_platform(wordSize) = 4
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = intel tcl_platform(os) = Windows NT tcl_platform(osVersion) = 6.0 tcl_platform(platform) = windows tcl_platform(wordSize) = 4
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(wordSize) = 4
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = intel tcl_platform(os) = Windows NT tcl_platform(osVersion) = 6.1 tcl_platform(pointerSize) = 4 tcl_platform(threaded) = 1 tcl_platform(wordSize) = 4
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(wordSize) = 4
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = amd64 tcl_platform(os) = Windows NT tcl_platform(osVersion) = 6.1 tcl_platform(platform) = windows tcl_platform(pointerSize) = 8 tcl_platform(threaded) = 1 tcl_platform(wordSize) = 4
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = amd64 tcl_platform(os) = Windows NT tcl_platform(osVersion) = 6.2 tcl_platform(pathSeparator) = ; tcl_platform(platform) = windows tcl_platform(pointerSize) = 8 tcl_platform(threaded) = 1 tcl_platform(wordSize) = 4
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = amd64 tcl_platform(os) = Windows NT tcl_platform(osVersion) = 6.3 tcl_platform(pathSeparator) = ; tcl_platform(platform) = windows tcl_platform(pointerSize) = 8 tcl_platform(threaded) = 1 tcl_platform(wordSize) = 4
Note that an older Tcl version will identify Windows 8.1 as osVersion 6.2. This is an artifact of the windows API.
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = intel tcl_platform(os) = Windows NT tcl_platform(osVersion) = 10.0 tcl_platform(pathSeparator) = ; tcl_platform(platform) = windows tcl_platform(pointerSize) = 4 tcl_platform(wordSize) = 4
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = amd64 tcl_platform(os) = Windows NT tcl_platform(osVersion) = 10.0 tcl_platform(pathSeparator) = ; tcl_platform(platform) = windows tcl_platform(pointerSize) = 8 tcl_platform(wordSize) = 4
Note: there is no way to obtain the bitsize of the OS, an important variable, e.g. when you're going to exec programs that exist in specific 32- and 64-bit versions. A quick and reliable method in distinguishing is by using the windows wmi framework as follows (but you could also use the twapi package):
lindex [exec wmic computersystem get systemtype] 1
Responses: X86-based or x64-based
This was tested with following systems with 64-bit CPUs: Win XP 32-bit, Win7 32-bit and Win7 64-bit.
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = arm tcl_platform(os) = Windows CE tcl_platform(osVersion) = 3.0 tcl_platform(platform) = windows
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(wordSize) = 4
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
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = x86pc tcl_platform(os) = QNX tcl_platform(osVersion) = 6.3.0 tcl_platform(platform) = unix
tcl_platform(byteOrder) = littleEndian tcl_platform(characterSize) = 2-2 tcl_platform(dirSeparator) = \ tcl_platform(engine) = Eagle tcl_platform(machine) = intel tcl_platform(os) = Windows NT tcl_platform(osPatchLevel) = 6.1.7601.65536 tcl_platform(osServicePack) = 1.0 tcl_platform(osVersion) = 6.1 tcl_platform(patchLevel) = 8.4.21 tcl_platform(pathSeparator) = ; tcl_platform(platform) = windows tcl_platform(pointerSize) = 4 tcl_platform(processBits) = 32 tcl_platform(processors) = 4 tcl_platform(threaded) = 1 tcl_platform(unicode) = 1 tcl_platform(version) = 8.4 tcl_platform(wordSize) = 4
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?
JoGusto - 2014-01-03
Win 7 Ultimate running Tcl 8.5 64-bit returns this:
tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = amd64 tcl_platform(os) = Windows NT tcl_platform(osVersion) = 6.1 tcl_platform(platform) = windows tcl_platform(pointerSize) = 8 tcl_platform(threaded) = 1 tcl_platform(wordSize) = 4
(AFAIK, Win 7 Ultimate, Professional, etc, all return the same Windows version information for (os) and (osVersion))
AMG: Since Microsoft has chosen to use the LLP64 model for 64-bit Windows, $tcl_platform(wordSize) is 4 on both 32- and 64-bit platforms. Hardly useful. Thankfully, we have $tcl_platform(pointerSize) and $tcl_platform(machine) to disambiguate.
For my application, I'd like to know the rules of the platform (actually, the compiler used to build Tcl) for alignment and size of various C types.
Is a double aligned on a 4- or 8-byte boundary? 32- and 64-bit Linux disagree on this point (unless you use -malign-double), though I think 32- and 64-bit Windows both use 8-byte boundaries, at least when using MSVC.
daneyul - 2015-9-9
This list is getting woefully out of date. Wish I had the computers available to fill in the blanks but sadly I do not. Anyone able to add entries for:
Mac: Mountain Lion (OSX 10.8), Maverick (OSX 10.9), Yosemite (OSX 10.10) and El Capitain (OSX 10.11) Windows: Windows 10
Torsten 2015.10.11 Added Maverick (OSX 10.9), systems folded to improve clarity
kicka - 2015-12-03 11:06:44
Added Android 5.0.2 Lollipop from my LG G2.