Debian Codegraph @

docs/api_reference/CXX/logfile.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::log_file()</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="lsn.html" title="Chapter 8.  The DbLsn Handle" />
11 <link rel="prev" href="logcursor.html" title="DbEnv::log_cursor()" />
12 <link rel="next" href="logflush.html" title="DbEnv::log_flush()" />
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::log_file()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="logcursor.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 8. 
26 The DbLsn Handle
27 </th>
28 <td width="20%" align="right"> <a accesskey="n" href="logflush.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="logfile"></a>DbEnv::log_file()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db_cxx.h&gt;
42
43 int
44 DbEnv::log_file(const DbLsn *lsn, char *namep, size_t len);</pre>
45 <p>
46 The <code class="methodname">DbEnv::log_file()</code> method maps
47 <code class="classname">DbLsn</code> structures to filenames,
48 returning the name of the file containing the record named by
49 <span class="bold"><strong>lsn</strong></span>.
50 </p>
51 <p>
52 This mapping of <code class="classname">DbLsn</code> structures to files is needed for database
53 administration. For example, a transaction manager typically records
54 the earliest <a class="link" href="lsn.html" title="Chapter 8.  The DbLsn Handle">DbLsn</a>
55 needed for restart, and the database administrator may want to archive
56 log files to tape when they contain only
57 <a class="link" href="lsn.html" title="Chapter 8.  The DbLsn Handle">DbLsn</a> entries before the
58 earliest one needed for restart.
59 </p>
60 <p>
61 The <code class="methodname">DbEnv::log_file()</code> <span>
62
63 <span>
64 method either returns a non-zero error value or throws an
65 exception that encapsulates a non-zero error value on
66 failure, and returns 0 on success.
67 </span>
68 </span>
69 </p>
70 <div class="sect2" lang="en" xml:lang="en">
71 <div class="titlepage">
72 <div>
73 <div>
74 <h3 class="title"><a id="idp8311920"></a>Parameters</h3>
75 </div>
76 </div>
77 </div>
78 <div class="sect3" lang="en" xml:lang="en">
79 <div class="titlepage">
80 <div>
81 <div>
82 <h4 class="title"><a id="idp8311272"></a>lsn</h4>
83 </div>
84 </div>
85 </div>
86 <p>
87 The <span class="bold"><strong>lsn</strong></span> parameter is the
88 <code class="classname">DbLsn</code> structure for which a
89 filename is wanted.
90 </p>
91 </div>
92 <div class="sect3" lang="en" xml:lang="en">
93 <div class="titlepage">
94 <div>
95 <div>
96 <h4 class="title"><a id="idp8282552"></a>namep</h4>
97 </div>
98 </div>
99 </div>
100 <p>
101 The <span class="bold"><strong>namep</strong></span> parameter references memory
102 into which the name of the file containing the record named by
103 <span class="bold"><strong>lsn</strong></span> is copied.
104 </p>
105 </div>
106 <div class="sect3" lang="en" xml:lang="en">
107 <div class="titlepage">
108 <div>
109 <div>
110 <h4 class="title"><a id="idp8270040"></a>len</h4>
111 </div>
112 </div>
113 </div>
114 <p>
115 The <span class="bold"><strong>len</strong></span> parameter is the length of
116 the <span class="bold"><strong>namep</strong></span> buffer in bytes. If
117 <span class="bold"><strong>namep</strong></span> is too short to hold the
118 filename, <code class="methodname">DbEnv::log_file()</code> will fail. (Log filenames
119 are always 14 characters long.)
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="idp8274816"></a>Errors</h3>
128 </div>
129 </div>
130 </div>
131 <p>
132 The <code class="methodname">DbEnv::log_file()</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="idp8320272"></a>EINVAL</h4>
146 </div>
147 </div>
148 </div>
149 <p>
150 If supplied buffer was too small to hold the log filename;
151 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="idp8318512"></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 <a class="link" href="logc.html" title="The DbLogc Handle">DbLogc</a>,
166 <a class="link" href="lsn.html" title="Chapter 8.  The DbLsn Handle">DbLsn</a>
167 </p>
168 </div>
169 <div class="sect2" lang="en" xml:lang="en">
170 <div class="titlepage">
171 <div>
172 <div>
173 <h3 class="title"><a id="idp8322800"></a>See Also</h3>
174 </div>
175 </div>
176 </div>
177 <p>
178 <a class="xref" href="lsn.html#loglist" title="Logging Subsystem and Related Methods">Logging Subsystem and Related Methods</a>
179 </p>
180 </div>
181 </div>
182 <div class="navfooter">
183 <hr />
184 <table width="100%" summary="Navigation footer">
185 <tr>
186 <td width="40%" align="left"><a accesskey="p" href="logcursor.html">Prev</a> </td>
187 <td width="20%" align="center">
188 <a accesskey="u" href="lsn.html">Up</a>
189 </td>
190 <td width="40%" align="right"> <a accesskey="n" href="logflush.html">Next</a></td>
191 </tr>
192 <tr>
193 <td width="40%" align="left" valign="top">DbEnv::log_cursor() </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::log_flush()</td>
198 </tr>
199 </table>
200 </div>
201 </body>
202 </html>