Debian Codegraph @

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