Debian Codegraph @

docs/api_reference/CXX/envset_intermediate_dir_mode.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_intermediate_dir_mode()</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_flags.html" title="DbEnv::set_flags()" />
12 <link rel="next" href="envset_isalive.html" title="DbEnv::set_isalive()" />
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_intermediate_dir_mode()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="envset_flags.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_isalive.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_intermediate_dir_mode"></a>DbEnv::set_intermediate_dir_mode()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db_cxx.h&gt;
42
43 int
44 DbEnv::set_intermediate_dir_mode(u_int32_t mode); </pre>
45 <p>
46 By default, Berkeley DB does not create intermediate directories
47 needed for recovery, that is, if the file <span class="bold"><strong>/a/b/c/mydatabase</strong></span> is being recovered, and the
48 directory path <span class="bold"><strong>b/c</strong></span> does not exist,
49 recovery will fail. This default behavior is because Berkeley DB
50 does not know what permissions are appropriate for intermediate
51 directory creation, and creating the directory might result in a
52 security problem.
53 </p>
54 <p>
55 The <code class="methodname">DbEnv::set_intermediate_dir_mode()</code> method causes Berkeley DB to
56 create any intermediate directories needed during recovery, using the
57 specified permissions.
58 </p>
59 <p>
60 On UNIX systems or in IEEE/ANSI Std 1003.1 (POSIX) environments,
61 created directories are owned by the process owner; the group
62 ownership of created directories is based on the system and directory
63 defaults, and is not further specified by Berkeley DB.
64 </p>
65 <p>
66 The database environment's intermediate directory permissions may
67 also be 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
68 syntax of the entry in that file is a single line with the string
69 "set_intermediate_dir_mode", one or more whitespace characters,
70 and the directory permissions. Because the <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file is
71 read when the database environment is opened, it will silently
72 overrule configuration done before that time.
73 </p>
74 <p>
75 The <code class="methodname">DbEnv::set_intermediate_dir_mode()</code> method configures operations
76 performed using the specified
77 <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a> handle, not all
78 operations performed on the underlying database environment.
79 </p>
80 <p>
81 The <code class="methodname">DbEnv::set_intermediate_dir_mode()</code> method may not be called
82 after the <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a>
83 method is called.
84 </p>
85 <p>
86 The <code class="methodname">DbEnv::set_intermediate_dir_mode()</code> <span>
87
88 <span>
89 method either returns a non-zero error value or throws an
90 exception that encapsulates a non-zero error value on
91 failure, and returns 0 on success.
92 </span>
93 </span>
94 </p>
95 <div class="sect2" lang="en" xml:lang="en">
96 <div class="titlepage">
97 <div>
98 <div>
99 <h3 class="title"><a id="idp7402192"></a>Parameters</h3>
100 </div>
101 </div>
102 </div>
103 <div class="sect3" lang="en" xml:lang="en">
104 <div class="titlepage">
105 <div>
106 <div>
107 <h4 class="title"><a id="idp7374304"></a>mode</h4>
108 </div>
109 </div>
110 </div>
111 <p>
112 The <span class="bold"><strong>mode</strong></span> parameter specifies the
113 directory permissions.
114 </p>
115 <p>
116 Directory permissions are interpreted as a string of nine characters,
117 using the character set <span class="bold"><strong>r</strong></span> (read),
118 <span class="bold"><strong>w</strong></span> (write), <span class="bold"><strong>x</strong></span> (execute or search), and <span class="bold"><strong>-</strong></span> (none). The first character is the read
119 permissions for the directory owner (set to either <span class="bold"><strong>r</strong></span> or <span class="bold"><strong>-</strong></span>). The
120 second character is the write permissions for the directory owner (set
121 to either <span class="bold"><strong>w</strong></span> or <span class="bold"><strong>-</strong></span>). The third character is the execute
122 permissions for the directory owner (set to either <span class="bold"><strong>x</strong></span> or <span class="bold"><strong>-</strong></span>).
123 </p>
124 <p>
125 Similarly, the second set of three characters are the read, write and
126 execute/search permissions for the directory group, and the third set
127 of three characters are the read, write and execute/search permissions
128 for all others. For example, the string <span class="bold"><strong>rwx------</strong></span> would configure read, write and
129 execute/search access for the owner only. The string <span class="bold"><strong>rwxrwx---</strong></span> would configure read, write and
130 execute/search access for both the owner and the group. The string
131 <span class="bold"><strong>rwxr-----</strong></span> would configure read, write
132 and execute/search access for the directory owner and read-only access
133 for the directory group.
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="idp7375744"></a>Errors</h3>
142 </div>
143 </div>
144 </div>
145 <p>
146 The <code class="methodname">DbEnv::set_intermediate_dir_mode()</code>
147 <span>
148
149 <span>
150 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a>
151 exception, encapsulating one of the following non-zero errors, or return one
152 of the following non-zero errors:
153 </span>
154 </span>
155 </p>
156 <div class="sect3" lang="en" xml:lang="en">
157 <div class="titlepage">
158 <div>
159 <div>
160 <h4 class="title"><a id="idp7473664"></a>EINVAL</h4>
161 </div>
162 </div>
163 </div>
164 <p>
165 If the method was called after <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a>
166 was called; or if an invalid flag value or parameter was specified.
167 </p>
168 </div>
169 </div>
170 <div class="sect2" lang="en" xml:lang="en">
171 <div class="titlepage">
172 <div>
173 <div>
174 <h3 class="title"><a id="idp7474992"></a>Class</h3>
175 </div>
176 </div>
177 </div>
178 <p>
179 <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a>
180 </p>
181 </div>
182 <div class="sect2" lang="en" xml:lang="en">
183 <div class="titlepage">
184 <div>
185 <div>
186 <h3 class="title"><a id="idp7392560"></a>See Also</h3>
187 </div>
188 </div>
189 </div>
190 <p>
191 <a class="xref" href="env.html#envlist" title="Database Environments and Related Methods">Database Environments and Related Methods</a>
192 </p>
193 </div>
194 </div>
195 <div class="navfooter">
196 <hr />
197 <table width="100%" summary="Navigation footer">
198 <tr>
199 <td width="40%" align="left"><a accesskey="p" href="envset_flags.html">Prev</a> </td>
200 <td width="20%" align="center">
201 <a accesskey="u" href="env.html">Up</a>
202 </td>
203 <td width="40%" align="right"> <a accesskey="n" href="envset_isalive.html">Next</a></td>
204 </tr>
205 <tr>
206 <td width="40%" align="left" valign="top">DbEnv::set_flags() </td>
207 <td width="20%" align="center">
208 <a accesskey="h" href="index.html">Home</a>
209 </td>
210 <td width="40%" align="right" valign="top"> DbEnv::set_isalive()</td>
211 </tr>
212 </table>
213 </div>
214 </body>
215 </html>