Debian Codegraph @

docs/api_reference/CXX/envset_tmp_dir.html

raw symbols SCIP
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>DbEnv::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 DbEnv Handle" />
11 <link rel="prev" href="envset_timeout.html" title="DbEnv::set_timeout()" />
12 <link rel="next" href="envset_verbose.html" title="DbEnv::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">DbEnv::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 DbEnv 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>DbEnv::set_tmp_dir()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db_cxx.h&gt;
42
43 int
44 DbEnv::set_tmp_dir(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">DbEnv::set_tmp_dir()</code> method configures
146 operations performed using the specified
147 <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a> handle, not all operations
148 performed on the underlying database environment.
149 </p>
150 <p>
151 The <code class="methodname">DbEnv::set_tmp_dir()</code> <span>
152
153 <span>
154 method either returns a non-zero error value or throws an
155 exception that encapsulates a non-zero error value on
156 failure, and returns 0 on success.
157 </span>
158 </span>
159 </p>
160 <div class="sect2" lang="en" xml:lang="en">
161 <div class="titlepage">
162 <div>
163 <div>
164 <h3 class="title"><a id="idp7674736"></a>Parameters</h3>
165 </div>
166 </div>
167 </div>
168 <div class="sect3" lang="en" xml:lang="en">
169 <div class="titlepage">
170 <div>
171 <div>
172 <h4 class="title"><a id="idp7699440"></a>dir</h4>
173 </div>
174 </div>
175 </div>
176 <p>
177 The <span class="bold"><strong>dir</strong></span> parameter is the
178 directory to be used to store temporary files. This
179 directory must currently exist at environment open time.
180 </p>
181 <p>
182 When using a Unicode build on Windows (the default), the
183 this argument will be interpreted as a UTF-8 string, which
184 is equivalent to ASCII for Latin characters.
185 </p>
186 </div>
187 </div>
188 <div class="sect2" lang="en" xml:lang="en">
189 <div class="titlepage">
190 <div>
191 <div>
192 <h3 class="title"><a id="idp7703216"></a>Errors</h3>
193 </div>
194 </div>
195 </div>
196 <p>
197 The <code class="methodname">DbEnv::set_tmp_dir()</code> <span>
198
199 <span>
200 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a>
201 exception, encapsulating one of the following non-zero errors, or return one
202 of the following non-zero errors:
203 </span>
204 </span>
205 </p>
206 <div class="sect3" lang="en" xml:lang="en">
207 <div class="titlepage">
208 <div>
209 <div>
210 <h4 class="title"><a id="idp7708472"></a>EINVAL</h4>
211 </div>
212 </div>
213 </div>
214 <p>
215 If the method was called after <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a>
216 was called; or if an invalid flag value or parameter was specified.
217 </p>
218 </div>
219 </div>
220 <div class="sect2" lang="en" xml:lang="en">
221 <div class="titlepage">
222 <div>
223 <div>
224 <h3 class="title"><a id="idp7709800"></a>Class</h3>
225 </div>
226 </div>
227 </div>
228 <p>
229 <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a>
230 </p>
231 </div>
232 <div class="sect2" lang="en" xml:lang="en">
233 <div class="titlepage">
234 <div>
235 <div>
236 <h3 class="title"><a id="idp7693208"></a>See Also</h3>
237 </div>
238 </div>
239 </div>
240 <p>
241 <a class="xref" href="env.html#envlist" title="Database Environments and Related Methods">Database Environments and Related Methods</a>
242 </p>
243 </div>
244 </div>
245 <div class="navfooter">
246 <hr />
247 <table width="100%" summary="Navigation footer">
248 <tr>
249 <td width="40%" align="left"><a accesskey="p" href="envset_timeout.html">Prev</a> </td>
250 <td width="20%" align="center">
251 <a accesskey="u" href="env.html">Up</a>
252 </td>
253 <td width="40%" align="right"> <a accesskey="n" href="envset_verbose.html">Next</a></td>
254 </tr>
255 <tr>
256 <td width="40%" align="left" valign="top">DbEnv::set_timeout() </td>
257 <td width="20%" align="center">
258 <a accesskey="h" href="index.html">Home</a>
259 </td>
260 <td width="40%" align="right" valign="top"> DbEnv::set_verbose()</td>
261 </tr>
262 </table>
263 </div>
264 </body>
265 </html>