platform

Relevant in the context of tcl:


LV Also the name of a new Tcl 8.5 package. This package, included in the core distribution, contains functions such as:

::platform::identify
::platform::generic
::platform::patterns

HE tried to use platform 1.0.2 with TCL/TK 8.4. It works (at least with 8.4.7 on win32-ix86)

DKF: See also platform::shell for when you want to determine the same information about a specific Tcl shell.


Can someone provde an example of how platform is to be used? How should shared libraries be placed and named so that a single directory can contain extensions for multiple platforms safely? Is there any reason why the info sharedlibextension isn't also accessible from platform?

What I'd like to see is something like load [::platform::extension basename], where platform::extension constructs the "appropriate" (whatever that means) filename for the extension. This would mean defining some naming scheme for extensions, but something similiar is already done inside the extension. The Extensionname_Init function can't be arbitrarily named either.


JMN 2008-03-06 When running a linux version of tclkit on FreeBSD 6.x using its linux binary compatibility - ::platform::identify returns linux-glibc2.3-ix86

tcl_platform(os) contains "Linux"

Presumably in this situation - only pure tcl modules, or modules that are also linux binaries can be loaded. I guess it makes sense to think of it as a little linux virtual machine as far as Tcl is concerned?


WHD Is there a list somewhere of what OS string platform::generic is likely to return for different platforms? I can see "macosx" on my own platform, and I can guess "linux" from the above comment. What does it return on Windows? "win32"? How about other flavors of Unix?

MG For me on Windws 7 64-bit, it returns "win32-x86_64".

WHD Per Andreas Kupries: For the ActiveState machines we get the following "full" identifiers:

  • aix-powerpc
  • aix-powerpc64
  • hpux-parisc
  • hpux-parisc64
  • hpux-ia64
  • hpux-ia64_32
  • linux-glibc2.3-ix86
  • linux-glibc2.3-x86_64
  • macosx10.5-i386-x86_64
  • macosx-universal
  • solaris2.10-ix86
  • solaris2.10-x86_64
  • solaris2.8-sparc
  • solaris2.8-sparc64
  • win32-ix86
  • win32-x86_64

See also: getWindowsAPIVendor.