• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt/router/db-4.8.30/docs/api_reference/C/
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_create_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_data_dir.html" title="DB_ENV-&gt;set_data_dir()" />
12    <link rel="next" href="envset_encrypt.html" title="DB_ENV-&gt;set_encrypt()" />
13  </head>
14  <body>
15    <div class="navheader">
16      <table width="100%" summary="Navigation header">
17        <tr>
18          <th colspan="3" align="center">DB_ENV-&gt;set_create_dir()</th>
19        </tr>
20        <tr>
21          <td width="20%" align="left"><a accesskey="p" href="envset_data_dir.html">Prev</a>��</td>
22          <th width="60%" align="center">Chapter��5.��
23                The DB_ENV Handle
24        </th>
25          <td width="20%" align="right">��<a accesskey="n" href="envset_encrypt.html">Next</a></td>
26        </tr>
27      </table>
28      <hr />
29    </div>
30    <div class="sect1" lang="en" xml:lang="en">
31      <div class="titlepage">
32        <div>
33          <div>
34            <h2 class="title" style="clear: both"><a id="envset_create_dir"></a>DB_ENV-&gt;set_create_dir()</h2>
35          </div>
36        </div>
37      </div>
38      <pre class="programlisting">#include &lt;db.h&gt;
39
40int
41DB_ENV-&gt;set_create_dir(DB_ENV *dbenv, const char *dir);  </pre>
42      <p>
43         Sets the path of a directory to be used as the location to create the access
44         method database files.  When the
45         <a class="xref" href="dbopen.html" title="DB-&gt;open()">DB-&gt;open()</a>  function is used to
46	     create a file it will be created relative to this path.  
47    </p>
48      <p>
49         If no database directories are specified, database files will be created
50         either by absolute paths or relative to the environment home
51         directory.  See 
52         <a href="../../programmer_reference/env_naming.html" class="olink">Berkeley DB File Naming</a> 
53         for more information.
54    </p>
55      <p>
56         The database environment's create directory may also be configured
57         using the environment's 
58         <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file.  The
59         syntax of the entry in that file is a single line with the string
60         "set_create_dir", one or more whitespace characters, and the directory
61         name.
62    </p>
63      <p>
64         The <code class="methodname">DB_ENV-&gt;set_create_dir()</code> method configures operations performed
65         using the specified <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a>  
66         handle, not all operations performed on the underlying database environment.
67    </p>
68      <p>
69         The <code class="methodname">DB_ENV-&gt;set_create_dir()</code> method may be called at any time.
70    </p>
71      <p>
72         The <code class="methodname">DB_ENV-&gt;set_create_dir()</code> <span>
73            <span>
74                  method returns a non-zero error value on failure and 0 on success.
75            </span>
76            
77        </span>
78    </p>
79      <div class="sect2" lang="en" xml:lang="en">
80        <div class="titlepage">
81          <div>
82            <div>
83              <h3 class="title"><a id="id1667418"></a>Parameters</h3>
84            </div>
85          </div>
86        </div>
87        <div class="sect3" lang="en" xml:lang="en">
88          <div class="titlepage">
89            <div>
90              <div>
91                <h4 class="title"><a id="id1667550"></a>dir</h4>
92              </div>
93            </div>
94          </div>
95          <p>
96                          The <span class="bold"><strong>dir</strong></span> parameter is a directory to
97                          be used to create database files.
98			  This directory must be one of the directories specified via a call to
99			  <a class="xref" href="envadd_data_dir.html" title="DB_ENV-&gt;add_data_dir()">DB_ENV-&gt;add_data_dir()</a>
100                     </p>
101          <p>
102                             When using a Unicode build on Windows (the default), this argument will be interpreted
103                             as a UTF-8 string, which is equivalent to ASCII for Latin characters.
104                     </p>
105        </div>
106      </div>
107      <div class="sect2" lang="en" xml:lang="en">
108        <div class="titlepage">
109          <div>
110            <div>
111              <h3 class="title"><a id="id1667614"></a>Errors</h3>
112            </div>
113          </div>
114        </div>
115        <p>
116                         The <code class="methodname">DB_ENV-&gt;set_create_dir()</code> <span>
117            <span>
118                 method may fail and return one of the following non-zero errors:
119            </span>
120            
121        </span>
122                    </p>
123        <div class="sect3" lang="en" xml:lang="en">
124          <div class="titlepage">
125            <div>
126              <div>
127                <h4 class="title"><a id="id1667581"></a>EINVAL</h4>
128              </div>
129            </div>
130          </div>
131          <p>
132                If the method was called after <a class="xref" href="envopen.html" title="DB_ENV-&gt;open()">DB_ENV-&gt;open()</a> 
133                was called; or if an invalid flag value or parameter was specified.
134            </p>
135        </div>
136      </div>
137      <div class="sect2" lang="en" xml:lang="en">
138        <div class="titlepage">
139          <div>
140            <div>
141              <h3 class="title"><a id="id1667544"></a>Class</h3>
142            </div>
143          </div>
144        </div>
145        <p>
146                <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a>  
147            </p>
148      </div>
149      <div class="sect2" lang="en" xml:lang="en">
150        <div class="titlepage">
151          <div>
152            <div>
153              <h3 class="title"><a id="id1667686"></a>See Also</h3>
154            </div>
155          </div>
156        </div>
157        <p>
158                     <a class="xref" href="env.html#envlist" title="Database Environments and Related Methods">Database Environments and Related Methods</a> 
159                </p>
160      </div>
161    </div>
162    <div class="navfooter">
163      <hr />
164      <table width="100%" summary="Navigation footer">
165        <tr>
166          <td width="40%" align="left"><a accesskey="p" href="envset_data_dir.html">Prev</a>��</td>
167          <td width="20%" align="center">
168            <a accesskey="u" href="env.html">Up</a>
169          </td>
170          <td width="40%" align="right">��<a accesskey="n" href="envset_encrypt.html">Next</a></td>
171        </tr>
172        <tr>
173          <td width="40%" align="left" valign="top">DB_ENV-&gt;set_data_dir()��</td>
174          <td width="20%" align="center">
175            <a accesskey="h" href="index.html">Home</a>
176          </td>
177          <td width="40%" align="right" valign="top">��DB_ENV-&gt;set_encrypt()</td>
178        </tr>
179      </table>
180    </div>
181  </body>
182</html>
183