{"id":6320,"date":"2022-12-20T18:58:09","date_gmt":"2022-12-20T21:58:09","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/platform-mann\/"},"modified":"2022-12-20T18:58:09","modified_gmt":"2022-12-20T21:58:09","slug":"platform-mann","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/platform-mann\/","title":{"rendered":"platform (mann)"},"content":{"rendered":"<h1 align=\"center\">platform<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#COMMANDS\">COMMANDS<\/a><br \/> <a href=\"#EXAMPLE\">EXAMPLE<\/a><br \/> <a href=\"#KEYWORDS\">KEYWORDS<\/a> <\/p>\n<hr>\n<p>______________________________________________________________________________<\/p>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">platform \u2212 System identification support code and utilities<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>package require platform ?1.0.10?<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>platform::generic <br \/> platform::identify <br \/> platform::patterns<\/b> <i>identifier<\/i> ______________________________________________________________________________<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>platform<\/b> package provides several utility commands useful for the identification of the architecture of a machine running Tcl.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Whilst Tcl provides the <b>tcl_platform<\/b> array for identifying the current architecture (in particular, the platform and machine elements) this is not always sufficient. This is because (on Unix machines) <b>tcl_platform<\/b> reflects the values returned by the <b>uname<\/b> command and these are not standardized across platforms and architectures. In addition, on at least one platform (AIX) the <b>tcl_platform(machine)<\/b> contains the CPU serial number.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Consequently, individual applications need to manipulate the values in <b>tcl_platform<\/b> (along with the output of system specific utilities) &#8211; which is both inconvenient for developers, and introduces the potential for inconsistencies in identifying architectures and in naming conventions.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>platform<\/b> package prevents such fragmentation &#8211; 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.<\/p>\n<h2>COMMANDS <a name=\"COMMANDS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>platform::identify<\/b><\/p>\n<p style=\"margin-left:22%;\">This command returns an identifier describing the platform the Tcl core is running on. The returned identifier has the general format <i>OS<\/i>&#8211;<i>CPU<\/i>. The <i>OS<\/i> part of the identifier may contain details like kernel version, libc version, etc., and this information may contain dashes as well. The <i>CPU<\/i> part will not contain dashes, making the preceding dash the last dash in the result.<\/p>\n<p style=\"margin-left:11%;\"><b>platform::generic<\/b><\/p>\n<p style=\"margin-left:22%;\">This command returns a simplified identifier describing the platform the Tcl core is running on. In contrast to <b>platform::identify<\/b> it leaves out details like kernel version, libc version, etc. The returned identifier has the general format <i>OS<\/i>&#8211;<i>CPU<\/i>.<\/p>\n<p style=\"margin-left:11%;\"><b>platform::patterns<\/b> <i>identifier<\/i><\/p>\n<p style=\"margin-left:22%;\">This command takes an identifier as returned by <b>platform::identify<\/b> and returns a list of identifiers describing compatible architectures.<\/p>\n<h2>EXAMPLE <a name=\"EXAMPLE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">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 versions of an operating system. For example:<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>package require platform<\/b> <br \/> # Assume that app script is &#8230;\/theapp\/bin\/theapp.tcl <br \/> set binDir [file dirname [file normalize [info script]]] <br \/> set libDir [file join $binDir .. lib] <br \/> set platLibDir [file join $libDir [<b>platform::identify<\/b>]] <br \/> load [file join $platLibDir support[info sharedlibextension]]<\/p>\n<h2>KEYWORDS <a name=\"KEYWORDS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">operating system, cpu architecture, platform, architecture<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  platform \u2212 System identification support code and utilities <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3783,1],"tags":[2635,2919],"class_list":["post-6320","post","type-post","status-publish","format-standard","hentry","category-n-comandos-tcl-tk","category-sin-categoria","tag-mann","tag-platform"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6320","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=6320"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6320\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=6320"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=6320"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=6320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}