appdirs.html 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <!-- This file is generated by Nim. -->
  4. <html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en" lang="en" data-theme="auto">
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <title>std/appdirs</title>
  9. <!-- Google fonts -->
  10. <link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
  11. <link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
  12. <!-- Favicon -->
  13. <link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAUAAAAF////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAIAAABbAAAAlQAAAKIAAACbAAAAmwAAAKIAAACVAAAAWwAAAAL///8A////AP///wD///8A////AAAAABQAAADAAAAAYwAAAA3///8A////AP///wD///8AAAAADQAAAGMAAADAAAAAFP///wD///8A////AP///wAAAACdAAAAOv///wD///8A////AP///wD///8A////AP///wD///8AAAAAOgAAAJ3///8A////AP///wAAAAAnAAAAcP///wAAAAAoAAAASv///wD///8A////AP///wAAAABKAAAAKP///wAAAABwAAAAJ////wD///8AAAAAgQAAABwAAACIAAAAkAAAAJMAAACtAAAAFQAAABUAAACtAAAAkwAAAJAAAACIAAAAHAAAAIH///8A////AAAAAKQAAACrAAAAaP///wD///8AAAAARQAAANIAAADSAAAARf///wD///8AAAAAaAAAAKsAAACk////AAAAADMAAACcAAAAnQAAABj///8A////AP///wAAAAAYAAAAGP///wD///8A////AAAAABgAAACdAAAAnAAAADMAAAB1AAAAwwAAAP8AAADpAAAAsQAAAE4AAAAb////AP///wAAAAAbAAAATgAAALEAAADpAAAA/wAAAMMAAAB1AAAAtwAAAOkAAAD/AAAA/wAAAP8AAADvAAAA3gAAAN4AAADeAAAA3gAAAO8AAAD/AAAA/wAAAP8AAADpAAAAtwAAAGUAAAA/AAAA3wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADfAAAAPwAAAGX///8A////AAAAAEgAAADtAAAAvwAAAL0AAADGAAAA7wAAAO8AAADGAAAAvQAAAL8AAADtAAAASP///wD///8A////AP///wD///8AAAAAO////wD///8A////AAAAAIcAAACH////AP///wD///8AAAAAO////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A//8AAP//AAD4HwAA7/cAAN/7AAD//wAAoYUAAJ55AACf+QAAh+EAAAAAAADAAwAA4AcAAP5/AAD//wAA//8AAA=="/>
  14. <link rel="icon" type="image/png" sizes="32x32" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4QQQEwksSS9ZWwAAAk1JREFUWMPtll2ITVEUx39nn/O7Y5qR8f05wtCUUr6ZIS++8pEnkZInPImneaCQ5METNdOkeFBKUhMPRIkHKfEuUZSUlGlKPN2TrgfncpvmnntnmlEyq1Z7t89/rf9a6+y99oZxGZf/XeIq61EdtgKXgdXA0xrYAvBjOIF1AI9zvjcC74BSpndrJPkBWDScTF8Aa4E3wDlgHbASaANmVqlcCnwHvgDvgVfAJ+AikAAvgfVZwLnSVZHZaOuKoQi3ZOMi4NkYkpe1p4J7A8BpYAD49hfIy/oqG0+hLomiKP2L5L+1ubn5115S+3OAn4EnwBlgMzCjyt6ZAnQCJ4A7wOs88iRJHvw50HoujuPBoCKwHWiosy8MdfZnAdcHk8dxXFJ3VQbQlCTJvRBCGdRbD4M6uc5glpY3eAihpN5S5w12diSEcCCEcKUO4ljdr15T76ur1FDDLIQQ3qv71EdDOe3Kxj3leRXyk+pxdWnFWod6Wt2bY3de3aSuUHcPBVimHs7mK9WrmeOF6lR1o9qnzskh2ar2qm1qizpfXaPeVGdlmGN5pb09qMxz1Xb1kLqgzn1RyH7JUXW52lr5e/Kqi9qpto7V1atuUzfnARrV7jEib1T76gG2qxdGmXyiekkt1GswPTtek0aBfJp6YySGBfWg2tPQ0FAYgf1stUfdmdcjarbYJEniKIq6gY/Aw+zWHAC+p2labGpqiorFYgGYCEzN7oQdQClN07O1/EfDyGgC0ALMBdYAi4FyK+4H3gLPsxfR1zRNi+NP7nH5J+QntnXe5B5mpfQAAAAASUVORK5CYII=">
  15. <!-- CSS -->
  16. <link rel="stylesheet" type="text/css" href="nimdoc.out.css?v=2.3.1">
  17. <!-- JS -->
  18. <script type="text/javascript" src="dochack.js?v=2.3.1"></script>
  19. </head>
  20. <body>
  21. <div class="document" id="documentId">
  22. <div class="container">
  23. <h1 class="title">std/appdirs</h1>
  24. <div class="row">
  25. <div class="three columns">
  26. <div class="theme-select-wrapper">
  27. <label for="theme-select">Theme:&nbsp;</label>
  28. <select id="theme-select" onchange="setTheme(this.value)">
  29. <option value="auto">🌗 Match OS</option>
  30. <option value="dark">🌑 Dark</option>
  31. <option value="light">🌕 Light</option>
  32. </select>
  33. </div>
  34. <div id="global-links">
  35. <ul class="simple-boot">
  36. <li><a href="manual.html">Manual</a></li>
  37. <li><a href="lib.html">Standard library</a></li>
  38. <li> <a id="indexLink" href="theindex.html">Index</a></li>
  39. <li><a href="compiler/theindex.html">Compiler docs</a></li>
  40. <li><a href="https://nim-lang.github.io/fusion/theindex.html">Fusion docs</a></li>
  41. <li><a href="https://nim-lang.github.io/Nim/">devel</a>, <a href="https://nim-lang.org/documentation.html">stable</a></li>
  42. </ul>
  43. </div>
  44. <div id="searchInputDiv">
  45. Search: <input type="search" id="searchInput"
  46. oninput="search()" />
  47. </div>
  48. <ul class="simple simple-toc" id="toc-list">
  49. <li>
  50. <a class="reference reference-toplevel" href="#6" id="56">Imports</a>
  51. </li>
  52. <li>
  53. <details open>
  54. <summary><a class="reference reference-toplevel" href="#12" id="62">Procs</a></summary>
  55. <ul class="simple simple-toc-section">
  56. <ul class="simple nested-toc-section">getCacheDir
  57. <li><a class="reference" href="#getCacheDir" title="getCacheDir(): Path">getCacheDir(): Path</a></li>
  58. <li><a class="reference" href="#getCacheDir%2CPath" title="getCacheDir(app: Path): Path">getCacheDir(app: Path): Path</a></li>
  59. </ul>
  60. <ul class="simple nested-toc-section">getConfigDir
  61. <li><a class="reference" href="#getConfigDir" title="getConfigDir(): Path">getConfigDir(): Path</a></li>
  62. </ul>
  63. <ul class="simple nested-toc-section">getDataDir
  64. <li><a class="reference" href="#getDataDir" title="getDataDir(): Path">getDataDir(): Path</a></li>
  65. </ul>
  66. <ul class="simple nested-toc-section">getHomeDir
  67. <li><a class="reference" href="#getHomeDir" title="getHomeDir(): Path">getHomeDir(): Path</a></li>
  68. </ul>
  69. <ul class="simple nested-toc-section">getTempDir
  70. <li><a class="reference" href="#getTempDir" title="getTempDir(): Path">getTempDir(): Path</a></li>
  71. </ul>
  72. </ul>
  73. </details>
  74. </li>
  75. </ul>
  76. </div>
  77. <div class="nine columns" id="content">
  78. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/appdirs.nim#L1" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  79. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/appdirs.nim#L1" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  80. <div id="tocRoot"></div>
  81. <p class="module-desc">This module implements helpers for determining special directories used by apps.</p>
  82. <div class="section" id="6">
  83. <h1><a class="toc-backref" href="#6">Imports</a></h1>
  84. <dl class="item">
  85. <a class="reference external" href="osappdirs.html">osappdirs</a>, <a class="reference external" href="paths.html">paths</a>, <a class="reference external" href="envvars.html">envvars</a>
  86. </dl>
  87. </div>
  88. <div class="section" id="12">
  89. <h1><a class="toc-backref" href="#12">Procs</a></h1>
  90. <dl class="item">
  91. <div id="getCacheDir-procs-all">
  92. <div id="getCacheDir">
  93. <dt><pre><span class="Keyword">proc</span> <a href="#getCacheDir"><span class="Identifier">getCacheDir</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <a href="paths.html#Path"><span class="Identifier">Path</span></a> {.<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadEnvEffect</span><span class="Other">]</span><span class="Other">,</span>
  94. <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  95. <dd>
  96. <p>Returns the cache directory of the current user for applications.</p>
  97. <p>This makes use of the following environment variables:</p>
  98. <ul class="simple"><li>On Windows: <tt class="docutils literal"><span class="pre"><span class="Identifier">getEnv</span><span class="Punctuation">(</span><span class="StringLit">&quot;LOCALAPPDATA&quot;</span><span class="Punctuation">)</span></span></tt></li>
  99. <li>On macOS: <tt class="docutils literal"><span class="pre"><span class="Identifier">getEnv</span><span class="Punctuation">(</span><span class="StringLit">&quot;XDG_CACHE_HOME&quot;</span><span class="Punctuation">,</span> <span class="Identifier">getEnv</span><span class="Punctuation">(</span><span class="StringLit">&quot;HOME&quot;</span><span class="Punctuation">)</span> <span class="Operator">/</span> <span class="StringLit">&quot;Library/Caches&quot;</span><span class="Punctuation">)</span></span></tt></li>
  100. <li>On other platforms: <tt class="docutils literal"><span class="pre"><span class="Identifier">getEnv</span><span class="Punctuation">(</span><span class="StringLit">&quot;XDG_CACHE_HOME&quot;</span><span class="Punctuation">,</span> <span class="Identifier">getEnv</span><span class="Punctuation">(</span><span class="StringLit">&quot;HOME&quot;</span><span class="Punctuation">)</span> <span class="Operator">/</span> <span class="StringLit">&quot;.cache&quot;</span><span class="Punctuation">)</span></span></tt></li>
  101. </ul>
  102. <p><strong>See also:</strong></p>
  103. <ul class="simple"><li><a class="reference internal nimdoc" title="proc getHomeDir(): Path" href="#getHomeDir">getHomeDir proc</a></li>
  104. <li><a class="reference internal nimdoc" title="proc getTempDir(): Path" href="#getTempDir">getTempDir proc</a></li>
  105. <li><a class="reference internal nimdoc" title="proc getConfigDir(): Path" href="#getConfigDir">getConfigDir proc</a></li>
  106. </ul>
  107. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/appdirs.nim#L53" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  108. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/appdirs.nim#L53" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  109. </dd>
  110. </div>
  111. <div id="getCacheDir,Path">
  112. <dt><pre><span class="Keyword">proc</span> <a href="#getCacheDir%2CPath"><span class="Identifier">getCacheDir</span></a><span class="Other">(</span><span class="Identifier">app</span><span class="Other">:</span> <a href="paths.html#Path"><span class="Identifier">Path</span></a><span class="Other">)</span><span class="Other">:</span> <a href="paths.html#Path"><span class="Identifier">Path</span></a> {.<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadEnvEffect</span><span class="Other">]</span><span class="Other">,</span>
  113. <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  114. <dd>
  115. Returns the cache directory for an application <tt class="docutils literal"><span class="pre"><span class="Identifier">app</span></span></tt>.<ul class="simple"><li>On Windows, this uses: <tt class="docutils literal"><span class="pre"><span class="Identifier">getCacheDir</span><span class="Punctuation">(</span><span class="Punctuation">)</span> <span class="Operator">/</span> <span class="Identifier">app</span> <span class="Operator">/</span> <span class="StringLit">&quot;cache&quot;</span></span></tt></li>
  116. <li>On other platforms, this uses: <tt class="docutils literal"><span class="pre"><span class="Identifier">getCacheDir</span><span class="Punctuation">(</span><span class="Punctuation">)</span> <span class="Operator">/</span> <span class="Identifier">app</span></span></tt></li>
  117. </ul>
  118. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/appdirs.nim#L71" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  119. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/appdirs.nim#L71" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  120. </dd>
  121. </div>
  122. </div>
  123. <div id="getConfigDir-procs-all">
  124. <div id="getConfigDir">
  125. <dt><pre><span class="Keyword">proc</span> <a href="#getConfigDir"><span class="Identifier">getConfigDir</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <a href="paths.html#Path"><span class="Identifier">Path</span></a> {.<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><a href="envvars.html#ReadEnvEffect"><span class="Identifier">ReadEnvEffect</span></a><span class="Other">,</span> <a href="exceptions.html#ReadIOEffect"><span class="Identifier">ReadIOEffect</span></a><span class="Other">]</span><span class="Other">,</span>
  126. <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  127. <dd>
  128. <p>Returns the config directory of the current user for applications.</p>
  129. <p>On non-Windows OSs, this proc conforms to the XDG Base Directory spec. Thus, this proc returns the value of the <tt class="docutils literal"><span class="pre"><span class="Identifier">XDG_CONFIG_HOME</span></span></tt> environment variable if it is set, otherwise it returns the default configuration directory (&quot;~/.config/&quot;).</p>
  130. <p>An OS-dependent trailing slash is always present at the end of the returned string: <tt class="docutils literal"><span class="pre"><span class="Operator">\\</span></span></tt> on Windows and <tt class="docutils literal"><span class="pre"><span class="Operator">/</span></span></tt> on all other OSs.</p>
  131. <p>See also:</p>
  132. <ul class="simple"><li><a class="reference internal nimdoc" title="proc getHomeDir(): Path" href="#getHomeDir">getHomeDir proc</a></li>
  133. <li><a class="reference internal nimdoc" title="proc getTempDir(): Path" href="#getTempDir">getTempDir proc</a></li>
  134. </ul>
  135. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/appdirs.nim#L37" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  136. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/appdirs.nim#L37" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  137. </dd>
  138. </div>
  139. </div>
  140. <div id="getDataDir-procs-all">
  141. <div id="getDataDir">
  142. <dt><pre><span class="Keyword">proc</span> <a href="#getDataDir"><span class="Identifier">getDataDir</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <a href="paths.html#Path"><span class="Identifier">Path</span></a> {.<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><a href="envvars.html#ReadEnvEffect"><span class="Identifier">ReadEnvEffect</span></a><span class="Other">,</span> <a href="exceptions.html#ReadIOEffect"><span class="Identifier">ReadIOEffect</span></a><span class="Other">]</span><span class="Other">,</span>
  143. <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  144. <dd>
  145. <p>Returns the data directory of the current user for applications.</p>
  146. <p>On non-Windows OSs, this proc conforms to the XDG Base Directory spec. Thus, this proc returns the value of the <tt class="docutils literal"><span class="pre"><span class="Identifier">XDG_DATA_HOME</span></span></tt> environment variable if it is set, otherwise it returns the default configuration directory (&quot;~/.local/share&quot; or &quot;~/Library/Application Support&quot; on macOS).</p>
  147. <p>See also:</p>
  148. <ul class="simple"><li><a class="reference internal nimdoc" title="proc getHomeDir(): Path" href="#getHomeDir">getHomeDir proc</a></li>
  149. <li><a class="reference internal nimdoc" title="proc getConfigDir(): Path" href="#getConfigDir">getConfigDir proc</a></li>
  150. <li><a class="reference internal nimdoc" title="proc getTempDir(): Path" href="#getTempDir">getTempDir proc</a></li>
  151. <li><a class="reference external" href="./paths.html#expandTilde,Path">paths: expandTilde proc</a></li>
  152. <li><a class="reference external" href="./paths.html#getCurrentDir">paths: getCurrentDir proc</a></li>
  153. <li><a class="reference internal" href="#setCurrentDir">setCurrentDir</a></li>
  154. </ul>
  155. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/appdirs.nim#L20" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  156. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/appdirs.nim#L20" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  157. </dd>
  158. </div>
  159. </div>
  160. <div id="getHomeDir-procs-all">
  161. <div id="getHomeDir">
  162. <dt><pre><span class="Keyword">proc</span> <a href="#getHomeDir"><span class="Identifier">getHomeDir</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <a href="paths.html#Path"><span class="Identifier">Path</span></a> {.<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><a href="envvars.html#ReadEnvEffect"><span class="Identifier">ReadEnvEffect</span></a><span class="Other">,</span> <a href="exceptions.html#ReadIOEffect"><span class="Identifier">ReadIOEffect</span></a><span class="Other">]</span><span class="Other">,</span>
  163. <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  164. <dd>
  165. <p>Returns the home directory of the current user.</p>
  166. <p>This proc is wrapped by the <a class="reference external" href="./paths.html#expandTilde,Path">paths: expandTilde proc</a> for the convenience of processing paths coming from user configuration files.</p>
  167. <p>See also:</p>
  168. <ul class="simple"><li><a class="reference internal nimdoc" title="proc getConfigDir(): Path" href="#getConfigDir">getConfigDir proc</a></li>
  169. <li><a class="reference internal nimdoc" title="proc getTempDir(): Path" href="#getTempDir">getTempDir proc</a></li>
  170. </ul>
  171. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/appdirs.nim#L9" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  172. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/appdirs.nim#L9" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  173. </dd>
  174. </div>
  175. </div>
  176. <div id="getTempDir-procs-all">
  177. <div id="getTempDir">
  178. <dt><pre><span class="Keyword">proc</span> <a href="#getTempDir"><span class="Identifier">getTempDir</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <a href="paths.html#Path"><span class="Identifier">Path</span></a> {.<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><a href="envvars.html#ReadEnvEffect"><span class="Identifier">ReadEnvEffect</span></a><span class="Other">,</span> <a href="exceptions.html#ReadIOEffect"><span class="Identifier">ReadIOEffect</span></a><span class="Other">]</span><span class="Other">,</span>
  179. <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  180. <dd>
  181. <p>Returns the temporary directory of the current user for applications to save temporary files in.</p>
  182. <p>On Windows, it calls <a class="reference external" href="https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-gettemppathw">GetTempPath</a>. On Posix based platforms, it will check <tt class="docutils literal"><span class="pre"><span class="Identifier">TMPDIR</span></span></tt>, <tt class="docutils literal"><span class="pre"><span class="Identifier">TEMP</span></span></tt>, <tt class="docutils literal"><span class="pre"><span class="Identifier">TMP</span></span></tt> and <tt class="docutils literal"><span class="pre"><span class="Identifier">TEMPDIR</span></span></tt> environment variables in order. On all platforms, <tt class="docutils literal"><span class="pre"><span class="Operator">/</span><span class="Identifier">tmp</span></span></tt> will be returned if the procs fails.</p>
  183. <p>You can override this implementation by adding <tt class="docutils literal"><span class="pre"><span class="Operator">-</span><span class="Identifier">d</span><span class="Punctuation">:</span><span class="Identifier">tempDir</span><span class="Operator">=</span><span class="Identifier">mytempname</span></span></tt> to your compiler invocation.</p>
  184. <div class="admonition admonition-info"><span class="admonition-info-text"><b>Note:</b></span>
  185. This proc does not check whether the returned path exists.</div>
  186. <p>See also:</p>
  187. <ul class="simple"><li><a class="reference internal nimdoc" title="proc getHomeDir(): Path" href="#getHomeDir">getHomeDir proc</a></li>
  188. <li><a class="reference internal nimdoc" title="proc getConfigDir(): Path" href="#getConfigDir">getConfigDir proc</a></li>
  189. </ul>
  190. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/appdirs.nim#L78" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  191. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/appdirs.nim#L78" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  192. </dd>
  193. </div>
  194. </div>
  195. </dl>
  196. </div>
  197. </div>
  198. </div>
  199. <div class="twelve-columns footer">
  200. <span class="nim-sprite"></span>
  201. <br>
  202. <small style="color: var(--hint);">Made with Nim. Generated: 2025-02-03 14:57:23 UTC</small>
  203. </div>
  204. </div>
  205. </div>
  206. <script defer data-domain="nim-lang.org" src="https://plausible.io/js/plausible.js"></script>
  207. </body>
  208. </html>