Go to main content

man pages section 1: User Commands

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

platform (1t)

Name

platform - System identification support code and utilities

Synopsis

package require platform ?1.0.10?

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

Description

platform(1t)                 Tcl Bundled Packages                 platform(1t)



______________________________________________________________________________

NAME
       platform - System identification support code and utilities

SYNOPSIS
       package require platform ?1.0.10?

       platform::generic
       platform::identify
       platform::patterns identifier
______________________________________________________________________________

DESCRIPTION
       The  platform  package provides several utility commands useful for the
       identification of the architecture of a machine running Tcl.

       Whilst Tcl provides the tcl_platform array for identifying the  current
       architecture (in particular, the platform and machine elements) this is
       not always sufficient. This is because (on Unix machines)  tcl_platform
       reflects  the  values  returned  by the uname command and these are not
       standardized across platforms and architectures.  In  addition,  on  at
       least  one  platform  (AIX)  the tcl_platform(machine) contains the CPU
       serial number.

       Consequently, individual applications need to manipulate the values  in
       tcl_platform  (along  with  the  output of system specific utilities) -
       which is both inconvenient for developers, and introduces the potential
       for  inconsistencies in identifying architectures and in naming conven-
       tions.

       The platform package prevents such fragmentation - i.e., it establishes
       a standard naming convention for architectures running Tcl and makes it
       more convenient for developers to identify the current  architecture  a
       Tcl program is running on.

COMMANDS
       platform::identify
              This  command  returns an identifier describing the platform the
              Tcl core is running on. The returned identifier has the  general
              format OS-CPU. The OS part of the identifier may contain details
              like kernel version, libc version, etc.,  and  this  information
              may  contain  dashes  as  well.   The  CPU part will not contain
              dashes, making the preceding dash the last dash in the result.

       platform::generic
              This command returns  a  simplified  identifier  describing  the
              platform  the  Tcl  core  is  running  on.  In contrast to plat-
              form::identify it leaves out details like kernel  version,  libc
              version, etc. The returned identifier has the general format OS-
              CPU.

       platform::patterns identifier
              This command takes an identifier as returned by  platform::iden-
              tify  and  returns  a  list of identifiers describing compatible
              architectures.

EXAMPLE
       This can be used to allow an application to be  shipped  with  multiple
       builds of a shared library, so that the same package works on many ver-
       sions of an operating system. For example:

              package require platform
              # Assume that app script is .../theapp/bin/theapp.tcl
              set binDir [file dirname [file normalize [info script]]]
              set libDir [file join $binDir .. lib]
              set platLibDir [file join $libDir [platform::identify]]
              load [file join $platLibDir support[info sharedlibextension]]

KEYWORDS
       operating system, cpu architecture, platform, architecture



ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:


       +---------------+------------------+
       |ATTRIBUTE TYPE | ATTRIBUTE VALUE  |
       +---------------+------------------+
       |Availability   | runtime/tcl-8    |
       +---------------+------------------+
       |Stability      | Uncommitted      |
       +---------------+------------------+

NOTES
       Source code for open source software components in Oracle  Solaris  can
       be found at https://www.oracle.com/downloads/opensource/solaris-source-
       code-downloads.html.

       This    software    was    built    from    source     available     at
       https://github.com/oracle/solaris-userland.    The  original  community
       source was downloaded from  http://prdownloads.sourceforge.net/tcl/tcl-
       core8.6.7-src.tar.gz.

       Further information about this software can be found on the open source
       community website at https://www.tcl.tk/.



platform                             1.0.4                        platform(1t)