| 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 3 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| 4 | <head> |
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
| 6 | <title>DB_ENV->set_tmp_dir()</title> |
| 7 | <link rel="stylesheet" href="apiReference.css" type="text/css" /> |
| 8 | <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> |
| 9 | <link rel="start" href="index.html" title="Berkeley DB C API Reference" /> |
| 10 | <link rel="up" href="env.html" title="Chapter 5. The DB_ENV Handle" /> |
| 11 | <link rel="prev" href="envset_timeout.html" title="DB_ENV->set_timeout()" /> |
| 12 | <link rel="next" href="envset_verbose.html" title="DB_ENV->set_verbose()" /> |
| 13 | </head> |
| 14 | <body> |
| 15 | <div xmlns="" class="navheader"> |
| 16 | <div class="libver"> |
| 17 | <p>Library Version 11.2.5.3</p> |
| 18 | </div> |
| 19 | <table width="100%" summary="Navigation header"> |
| 20 | <tr> |
| 21 | <th colspan="3" align="center">DB_ENV->set_tmp_dir()</th> |
| 22 | </tr> |
| 23 | <tr> |
| 24 | <td width="20%" align="left"><a accesskey="p" href="envset_timeout.html">Prev</a> </td> |
| 25 | <th width="60%" align="center">Chapter 5. |
| 26 | The DB_ENV Handle |
| 27 | </th> |
| 28 | <td width="20%" align="right"> <a accesskey="n" href="envset_verbose.html">Next</a></td> |
| 29 | </tr> |
| 30 | </table> |
| 31 | <hr /> |
| 32 | </div> |
| 33 | <div class="sect1" lang="en" xml:lang="en"> |
| 34 | <div class="titlepage"> |
| 35 | <div> |
| 36 | <div> |
| 37 | <h2 class="title" style="clear: both"><a id="envset_tmp_dir"></a>DB_ENV->set_tmp_dir()</h2> |
| 38 | </div> |
| 39 | </div> |
| 40 | </div> |
| 41 | <pre class="programlisting">#include <db.h> |
| 42 | |
| 43 | int |
| 44 | DB_ENV->set_tmp_dir(DB_ENV *dbenv, const char *dir); </pre> |
| 45 | <p> |
| 46 | Specify the path of a directory to be used as the location of |
| 47 | temporary files. The files created to back in-memory access method |
| 48 | databases will be created relative to this path. These temporary |
| 49 | files can be quite large, depending on the size of the database. |
| 50 | </p> |
| 51 | <p> |
| 52 | If no directories are specified, the following alternatives are |
| 53 | checked in the specified order. The first existing directory path is |
| 54 | used for all temporary files. |
| 55 | </p> |
| 56 | <div class="orderedlist"> |
| 57 | <ol type="1"> |
| 58 | <li> |
| 59 | <p> |
| 60 | The value of the environment variable |
| 61 | <span class="bold"><strong>TMPDIR</strong></span>. |
| 62 | </p> |
| 63 | </li> |
| 64 | <li> |
| 65 | <p> |
| 66 | The value of the environment variable |
| 67 | <span class="bold"><strong>TEMP</strong></span>. |
| 68 | </p> |
| 69 | </li> |
| 70 | <li> |
| 71 | <p> |
| 72 | The value of the environment variable |
| 73 | <span class="bold"><strong>TMP</strong></span>. |
| 74 | </p> |
| 75 | </li> |
| 76 | <li> |
| 77 | <p> |
| 78 | The value of the environment variable |
| 79 | <span class="bold"><strong>TempFolder</strong></span>. |
| 80 | </p> |
| 81 | </li> |
| 82 | <li> |
| 83 | <p> |
| 84 | The value returned by the |
| 85 | <span class="bold"><strong>GetTempPath</strong></span> interface. |
| 86 | </p> |
| 87 | </li> |
| 88 | <li> |
| 89 | <p> |
| 90 | The directory <span class="bold"><strong>/var/tmp</strong></span>. |
| 91 | </p> |
| 92 | </li> |
| 93 | <li> |
| 94 | <p> |
| 95 | The directory <span class="bold"><strong>/usr/tmp</strong></span>. |
| 96 | </p> |
| 97 | </li> |
| 98 | <li> |
| 99 | <p> |
| 100 | The directory <span class="bold"><strong>/temp</strong></span>. |
| 101 | </p> |
| 102 | </li> |
| 103 | <li> |
| 104 | <p> |
| 105 | The directory <span class="bold"><strong>/tmp</strong></span>. |
| 106 | </p> |
| 107 | </li> |
| 108 | <li> |
| 109 | <p> |
| 110 | The directory <span class="bold"><strong>C:/temp</strong></span>. |
| 111 | </p> |
| 112 | </li> |
| 113 | <li> |
| 114 | <p> |
| 115 | The directory <span class="bold"><strong>C:/tmp</strong></span>. |
| 116 | </p> |
| 117 | </li> |
| 118 | </ol> |
| 119 | </div> |
| 120 | <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> |
| 121 | <h3 class="title">Note</h3> |
| 122 | <p> |
| 123 | Environment variables are only checked if one of the |
| 124 | <a class="link" href="envopen.html#envopen_DB_USE_ENVIRON">DB_USE_ENVIRON</a> or |
| 125 | <a class="link" href="envopen.html#envopen_DB_USE_ENVIRON_ROOT">DB_USE_ENVIRON_ROOT</a> |
| 126 | flags were specified. |
| 127 | </p> |
| 128 | </div> |
| 129 | <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> |
| 130 | <h3 class="title">Note</h3> |
| 131 | <p> |
| 132 | The GetTempPath interface is only checked on Win/32 platforms. |
| 133 | </p> |
| 134 | </div> |
| 135 | <p> |
| 136 | The database environment's temporary file directory may also be |
| 137 | configured using the environment's <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file. The syntax |
| 138 | of the entry in that file is a single line with the string |
| 139 | "set_tmp_dir", one or more whitespace characters, and the |
| 140 | directory name. Because the <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file is read when the |
| 141 | database environment is opened, it will silently overrule |
| 142 | configuration done before that time. |
| 143 | </p> |
| 144 | <p> |
| 145 | The <code class="methodname">DB_ENV->set_tmp_dir()</code> method configures |
| 146 | operations performed using the specified |
| 147 | <a class="link" href="env.html" title="Chapter 5. The DB_ENV Handle">DB_ENV</a> handle, not all operations |
| 148 | performed on the underlying database environment. |
| 149 | </p> |
| 150 | <p> |
| 151 | The <code class="methodname">DB_ENV->set_tmp_dir()</code> <span> |
| 152 | <span> |
| 153 | method returns a non-zero error value on failure and 0 on success. |
| 154 | </span> |
| 155 | |
| 156 | </span> |
| 157 | </p> |
| 158 | <div class="sect2" lang="en" xml:lang="en"> |
| 159 | <div class="titlepage"> |
| 160 | <div> |
| 161 | <div> |
| 162 | <h3 class="title"><a id="idp52329320"></a>Parameters</h3> |
| 163 | </div> |
| 164 | </div> |
| 165 | </div> |
| 166 | <div class="sect3" lang="en" xml:lang="en"> |
| 167 | <div class="titlepage"> |
| 168 | <div> |
| 169 | <div> |
| 170 | <h4 class="title"><a id="idp52329168"></a>dir</h4> |
| 171 | </div> |
| 172 | </div> |
| 173 | </div> |
| 174 | <p> |
| 175 | The <span class="bold"><strong>dir</strong></span> parameter is the |
| 176 | directory to be used to store temporary files. This |
| 177 | directory must currently exist at environment open time. |
| 178 | </p> |
| 179 | <p> |
| 180 | When using a Unicode build on Windows (the default), the |
| 181 | this argument will be interpreted as a UTF-8 string, which |
| 182 | is equivalent to ASCII for Latin characters. |
| 183 | </p> |
| 184 | </div> |
| 185 | </div> |
| 186 | <div class="sect2" lang="en" xml:lang="en"> |
| 187 | <div class="titlepage"> |
| 188 | <div> |
| 189 | <div> |
| 190 | <h3 class="title"><a id="idp52332832"></a>Errors</h3> |
| 191 | </div> |
| 192 | </div> |
| 193 | </div> |
| 194 | <p> |
| 195 | The <code class="methodname">DB_ENV->set_tmp_dir()</code> <span> |
| 196 | <span> |
| 197 | method may fail and return one of the following non-zero errors: |
| 198 | </span> |
| 199 | |
| 200 | </span> |
| 201 | </p> |
| 202 | <div class="sect3" lang="en" xml:lang="en"> |
| 203 | <div class="titlepage"> |
| 204 | <div> |
| 205 | <div> |
| 206 | <h4 class="title"><a id="idp52308288"></a>EINVAL</h4> |
| 207 | </div> |
| 208 | </div> |
| 209 | </div> |
| 210 | <p> |
| 211 | If the method was called after <a class="xref" href="envopen.html" title="DB_ENV->open()">DB_ENV->open()</a> |
| 212 | was called; or if an invalid flag value or parameter was specified. |
| 213 | </p> |
| 214 | </div> |
| 215 | </div> |
| 216 | <div class="sect2" lang="en" xml:lang="en"> |
| 217 | <div class="titlepage"> |
| 218 | <div> |
| 219 | <div> |
| 220 | <h3 class="title"><a id="idp52316056"></a>Class</h3> |
| 221 | </div> |
| 222 | </div> |
| 223 | </div> |
| 224 | <p> |
| 225 | <a class="link" href="env.html" title="Chapter 5. The DB_ENV Handle">DB_ENV</a> |
| 226 | </p> |
| 227 | </div> |
| 228 | <div class="sect2" lang="en" xml:lang="en"> |
| 229 | <div class="titlepage"> |
| 230 | <div> |
| 231 | <div> |
| 232 | <h3 class="title"><a id="idp52337504"></a>See Also</h3> |
| 233 | </div> |
| 234 | </div> |
| 235 | </div> |
| 236 | <p> |
| 237 | <a class="xref" href="env.html#envlist" title="Database Environments and Related Methods">Database Environments and Related Methods</a> |
| 238 | </p> |
| 239 | </div> |
| 240 | </div> |
| 241 | <div class="navfooter"> |
| 242 | <hr /> |
| 243 | <table width="100%" summary="Navigation footer"> |
| 244 | <tr> |
| 245 | <td width="40%" align="left"><a accesskey="p" href="envset_timeout.html">Prev</a> </td> |
| 246 | <td width="20%" align="center"> |
| 247 | <a accesskey="u" href="env.html">Up</a> |
| 248 | </td> |
| 249 | <td width="40%" align="right"> <a accesskey="n" href="envset_verbose.html">Next</a></td> |
| 250 | </tr> |
| 251 | <tr> |
| 252 | <td width="40%" align="left" valign="top">DB_ENV->set_timeout() </td> |
| 253 | <td width="20%" align="center"> |
| 254 | <a accesskey="h" href="index.html">Home</a> |
| 255 | </td> |
| 256 | <td width="40%" align="right" valign="top"> DB_ENV->set_verbose()</td> |
| 257 | </tr> |
| 258 | </table> |
| 259 | </div> |
| 260 | </body> |
| 261 | </html> |