Debian Codegraph @

docs/api_reference/CXX/envadd_data_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::add_data_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="env.html" title="Chapter 5.  The DbEnv Handle" />
12 <link rel="next" href="envbackup.html" title="DbEnv::backup()" />
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::add_data_dir()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="env.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="envbackup.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="envadd_data_dir"></a>DbEnv::add_data_dir()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db_cxx.h&gt;
42
43 int
44 DbEnv::add_data_dir(const char *dir); </pre>
45 <p>
46 Add the path of a directory to be used as the location of the access
47 method database files. Paths specified to the
48 <a class="xref" href="dbopen.html" title="Db::open()">Db::open()</a> function will be
49 searched relative to this path. Paths set using this method are
50 additive, and specifying more than one will result in each specified
51 directory being searched for database files.
52 </p>
53 <p>
54 If no database directories are specified, database files must be named
55 either by absolute paths or relative to the environment home
56 directory. See
57 <a href="../../programmer_reference/env_naming.html" class="olink">Berkeley DB File Naming</a>
58 for more information.
59 </p>
60 <p>
61 The database environment's data directories may also be configured
62 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 of the entry
63 in that file is a single line with the string "add_data_dir", one
64 or more whitespace characters, and the directory name.
65 Note that if you use this method for your application, and you also want to use the
66 <a class="xref" href="db_recover.html" title="db_recover">db_recover</a> or
67 <a class="xref" href="db_archive.html" title="db_archive">db_archive</a>
68 utilities, then you should create a <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file and set
69 the "add_data_dir" parameter in it.
70 </p>
71 <p>
72 The <code class="methodname">DbEnv::add_data_dir()</code> method configures operations performed
73 using the specified <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a>
74 handle, not all operations performed on the underlying database environment.
75 </p>
76 <p>
77 The <code class="methodname">DbEnv::add_data_dir()</code> method may not be called after the
78 <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a> method is called.
79 If the database environment already exists when
80 <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a> is called, the
81 information specified to <code class="methodname">DbEnv::add_data_dir()</code> must be consistent
82 with the existing environment or corruption can occur.
83 </p>
84 <p>
85 The <code class="methodname">DbEnv::add_data_dir()</code> <span>
86
87 <span>
88 method either returns a non-zero error value or throws an
89 exception that encapsulates a non-zero error value on
90 failure, and returns 0 on success.
91 </span>
92 </span>
93 </p>
94 <div class="sect2" lang="en" xml:lang="en">
95 <div class="titlepage">
96 <div>
97 <div>
98 <h3 class="title"><a id="idp6565744"></a>Parameters</h3>
99 </div>
100 </div>
101 </div>
102 <div class="sect3" lang="en" xml:lang="en">
103 <div class="titlepage">
104 <div>
105 <div>
106 <h4 class="title"><a id="idp6566392"></a>dir</h4>
107 </div>
108 </div>
109 </div>
110 <p>
111 The <span class="bold"><strong>dir</strong></span> parameter is a
112 directory to be used as a location for database files.
113 This directory must currently exist at environment open
114 time.
115 </p>
116 <p>
117 When using a Unicode build on Windows (the default), this
118 argument will be interpreted as a UTF-8 string, which is
119 equivalent to ASCII for Latin characters.
120 </p>
121 </div>
122 </div>
123 <div class="sect2" lang="en" xml:lang="en">
124 <div class="titlepage">
125 <div>
126 <div>
127 <h3 class="title"><a id="idp6562440"></a>Errors</h3>
128 </div>
129 </div>
130 </div>
131 <p>
132 The <code class="methodname">DbEnv::add_data_dir()</code> <span>
133
134 <span>
135 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a>
136 exception, encapsulating one of the following non-zero errors, or return one
137 of the following non-zero errors:
138 </span>
139 </span>
140 </p>
141 <div class="sect3" lang="en" xml:lang="en">
142 <div class="titlepage">
143 <div>
144 <div>
145 <h4 class="title"><a id="idp6588112"></a>EINVAL</h4>
146 </div>
147 </div>
148 </div>
149 <p>
150 If the method was called after <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a>
151 was called; or if an invalid flag value or parameter was specified.
152 </p>
153 </div>
154 </div>
155 <div class="sect2" lang="en" xml:lang="en">
156 <div class="titlepage">
157 <div>
158 <div>
159 <h3 class="title"><a id="idp6589440"></a>Class</h3>
160 </div>
161 </div>
162 </div>
163 <p>
164 <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a>
165 </p>
166 </div>
167 <div class="sect2" lang="en" xml:lang="en">
168 <div class="titlepage">
169 <div>
170 <div>
171 <h3 class="title"><a id="idp6562656"></a>See Also</h3>
172 </div>
173 </div>
174 </div>
175 <p>
176 <a class="xref" href="env.html#envlist" title="Database Environments and Related Methods">Database Environments and Related Methods</a>
177 </p>
178 </div>
179 </div>
180 <div class="navfooter">
181 <hr />
182 <table width="100%" summary="Navigation footer">
183 <tr>
184 <td width="40%" align="left"><a accesskey="p" href="env.html">Prev</a> </td>
185 <td width="20%" align="center">
186 <a accesskey="u" href="env.html">Up</a>
187 </td>
188 <td width="40%" align="right"> <a accesskey="n" href="envbackup.html">Next</a></td>
189 </tr>
190 <tr>
191 <td width="40%" align="left" valign="top">Chapter 5. 
192 The DbEnv Handle
193  </td>
194 <td width="20%" align="center">
195 <a accesskey="h" href="index.html">Home</a>
196 </td>
197 <td width="40%" align="right" valign="top"> DbEnv::backup()</td>
198 </tr>
199 </table>
200 </div>
201 </body>
202 </html>