<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE TIP SYSTEM "http://www.tcl.tk/cgi-bin/tct/tip/tipxml.dtd">
<!-- Converted at Sun Feb 12 12:14:42 GMT 2012 -->
<!-- TIP AutoGenerator - written by Donal K. Fellows -->

<TIP number='315'>
<header><title>Add pathSeparator to tcl_platform Array</title><author address="mailto:haivu2004@gmail.com">Hai Vu</author><status type='project' state='final' tclversion="8.6" vote='after'>$Revision: 1.5 $</status><history></history><created day='4' month='apr' year='2008' /></header>
<abstract>This TIP proposes a mechanism for determining the platform&apos;s path separator. The path separator is currently &quot;:&quot; in Unix and &quot;;&quot; in DOS/Windows.</abstract>
<body><section title="Rationale">
<para>Under Windows, the PATH environment variable consists of many paths, separated by semicolons (&quot;;&quot;). Meanwhile, Unix uses colon to separate the paths (&quot;:&quot;). Scripts that need to work on both platforms while parsing platform-specific PATH-like environment variables (PATH is just the most common of these) currently need to contain the mapping from platform-type to separator, but this is not especially flexible and some script authors are also inclined to forget about this particular difference.</para>
<para>Thus, to aid portability, this TIP proposes adding an element to the <emph style="bold">tcl_platform</emph> array, <emph style="bold">pathSeparator</emph>, which describes the path separator for the current platform.</para>
</section>
<section title="Example Usage">
<para>The following example prints each component of the PATH environment on a separate line:</para>
<verbatim><vline encoding='base64'>c2V0IHBhdGhMaXN0IFtzcGxpdCAkZW52KFBBVEgpICR0Y2xfcGxhdGZvcm0ocGF0aFNlcGFyYXRvcild</vline><vline encoding='base64'>Zm9yZWFjaCBwYXRoICRwYXRoTGlzdCB7</vline><vline encoding='base64'>ICAgIHB1dHMgJHBhdGhMaXN0</vline><vline encoding='base64'>fQ==</vline></verbatim>
<para>Alternatively:</para>
<verbatim><vline encoding='base64'>cHV0cyBbc3RyaW5nIG1hcCBbbGlzdCAkdGNsX3BsYXRmb3JtKHBhdGhTZXBhcmF0b3IpIFxuXSAkZW52KFBBVEgpXQ==</vline></verbatim>
</section>
<section title="Copyright">
<para>This document has been placed in the public domain.</para>
</section>
</body></TIP>

