Debian Codegraph @

docs/api_reference/C/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>DB_ENV-&gt;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 DB_ENV Handle" />
11 <link rel="prev" href="env.html" title="Chapter 5.  The DB_ENV Handle" />
12 <link rel="next" href="envbackup.html" title="DB_ENV-&gt;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">DB_ENV-&gt;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 DB_ENV 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>DB_ENV-&gt;add_data_dir()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db.h&gt;
42
43 int
44 DB_ENV-&gt;add_data_dir(DB_ENV *dbenv, 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-&gt;open()">DB-&gt;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">DB_ENV-&gt;add_data_dir()</code> method configures operations performed
73 using the specified <a class="link" href="env.html" title="Chapter 5.  The DB_ENV Handle">DB_ENV</a>
74 handle, not all operations performed on the underlying database environment.
75 </p>
76 <p>
77 The <code class="methodname">DB_ENV-&gt;add_data_dir()</code> method may not be called after the
78 <a class="xref" href="envopen.html" title="DB_ENV-&gt;open()">DB_ENV-&gt;open()</a> method is called.
79 If the database environment already exists when
80 <a class="xref" href="envopen.html" title="DB_ENV-&gt;open()">DB_ENV-&gt;open()</a> is called, the
81 information specified to <code class="methodname">DB_ENV-&gt;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">DB_ENV-&gt;add_data_dir()</code> <span>
86 <span>
87 method returns a non-zero error value on failure and 0 on success.
88 </span>
89
90 </span>
91 </p>
92 <div class="sect2" lang="en" xml:lang="en">
93 <div class="titlepage">
94 <div>
95 <div>
96 <h3 class="title"><a id="idp51236296"></a>Parameters</h3>
97 </div>
98 </div>
99 </div>
100 <div class="sect3" lang="en" xml:lang="en">
101 <div class="titlepage">
102 <div>
103 <div>
104 <h4 class="title"><a id="idp51221976"></a>dir</h4>
105 </div>
106 </div>
107 </div>
108 <p>
109 The <span class="bold"><strong>dir</strong></span> parameter is a
110 directory to be used as a location for database files.
111 This directory must currently exist at environment open
112 time.
113 </p>
114 <p>
115 When using a Unicode build on Windows (the default), this
116 argument will be interpreted as a UTF-8 string, which is
117 equivalent to ASCII for Latin characters.
118 </p>
119 </div>
120 </div>
121 <div class="sect2" lang="en" xml:lang="en">
122 <div class="titlepage">
123 <div>
124 <div>
125 <h3 class="title"><a id="idp51239784"></a>Errors</h3>
126 </div>
127 </div>
128 </div>
129 <p>
130 The <code class="methodname">DB_ENV-&gt;add_data_dir()</code> <span>
131 <span>
132 method may fail and return one of the following non-zero errors:
133 </span>
134
135 </span>
136 </p>
137 <div class="sect3" lang="en" xml:lang="en">
138 <div class="titlepage">
139 <div>
140 <div>
141 <h4 class="title"><a id="idp51254392"></a>EINVAL</h4>
142 </div>
143 </div>
144 </div>
145 <p>
146 If the method was called after <a class="xref" href="envopen.html" title="DB_ENV-&gt;open()">DB_ENV-&gt;open()</a>
147 was called; or if an invalid flag value or parameter was specified.
148 </p>
149 </div>
150 </div>
151 <div class="sect2" lang="en" xml:lang="en">
152 <div class="titlepage">
153 <div>
154 <div>
155 <h3 class="title"><a id="idp51220144"></a>Class</h3>
156 </div>
157 </div>
158 </div>
159 <p>
160 <a class="link" href="env.html" title="Chapter 5.  The DB_ENV Handle">DB_ENV</a>
161 </p>
162 </div>
163 <div class="sect2" lang="en" xml:lang="en">
164 <div class="titlepage">
165 <div>
166 <div>
167 <h3 class="title"><a id="idp51256520"></a>See Also</h3>
168 </div>
169 </div>
170 </div>
171 <p>
172 <a class="xref" href="env.html#envlist" title="Database Environments and Related Methods">Database Environments and Related Methods</a>
173 </p>
174 </div>
175 </div>
176 <div class="navfooter">
177 <hr />
178 <table width="100%" summary="Navigation footer">
179 <tr>
180 <td width="40%" align="left"><a accesskey="p" href="env.html">Prev</a> </td>
181 <td width="20%" align="center">
182 <a accesskey="u" href="env.html">Up</a>
183 </td>
184 <td width="40%" align="right"> <a accesskey="n" href="envbackup.html">Next</a></td>
185 </tr>
186 <tr>
187 <td width="40%" align="left" valign="top">Chapter 5. 
188 The DB_ENV Handle
189  </td>
190 <td width="20%" align="center">
191 <a accesskey="h" href="index.html">Home</a>
192 </td>
193 <td width="40%" align="right" valign="top"> DB_ENV-&gt;backup()</td>
194 </tr>
195 </table>
196 </div>
197 </body>
198 </html>