• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>file_mode</title>
5<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7<link rel="home" href="../../index.html" title="Chapter 1. Boost.Beast">
8<link rel="up" href="../ref.html" title="This Page Intentionally Left Blank 2/2">
9<link rel="prev" href="boost__beast__condition.html" title="condition">
10<link rel="next" href="boost__beast__role_type.html" title="role_type">
11</head>
12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13<table cellpadding="2" width="100%"><tr>
14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
15<td align="center"><a href="../../../../../../index.html">Home</a></td>
16<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
20</tr></table>
21<hr>
22<div class="spirit-nav">
23<a accesskey="p" href="boost__beast__condition.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="boost__beast__role_type.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
24</div>
25<div class="section">
26<div class="titlepage"><div><div><h4 class="title">
27<a name="beast.ref.boost__beast__file_mode"></a><a class="link" href="boost__beast__file_mode.html" title="file_mode">file_mode</a>
28</h4></div></div></div>
29<p>
30        <a class="indexterm" name="idm46057515062656"></a>
31      </p>
32<p>
33        File open modes.
34      </p>
35<h5>
36<a name="beast.ref.boost__beast__file_mode.h0"></a>
37        <span class="phrase"><a name="beast.ref.boost__beast__file_mode.synopsis"></a></span><a class="link" href="boost__beast__file_mode.html#beast.ref.boost__beast__file_mode.synopsis">Synopsis</a>
38      </h5>
39<p>
40        Defined in header <code class="literal">&lt;<a href="../../../../../../boost/beast/core/file_base.hpp" target="_top">boost/beast/core/file_base.hpp</a>&gt;</code>
41      </p>
42<pre class="programlisting"><span class="keyword">enum</span> <span class="identifier">file_mode</span>
43</pre>
44<h5>
45<a name="beast.ref.boost__beast__file_mode.h1"></a>
46        <span class="phrase"><a name="beast.ref.boost__beast__file_mode.values"></a></span><a class="link" href="boost__beast__file_mode.html#beast.ref.boost__beast__file_mode.values">Values</a>
47      </h5>
48<div class="informaltable"><table class="table">
49<colgroup>
50<col>
51<col>
52</colgroup>
53<thead><tr>
54<th>
55                <p>
56                  Name
57                </p>
58              </th>
59<th>
60                <p>
61                  Description
62                </p>
63              </th>
64</tr></thead>
65<tbody>
66<tr>
67<td>
68                <p>
69                  <code class="computeroutput"><span class="identifier">read</span></code>
70                </p>
71              </td>
72<td>
73                <p>
74                  Random read-only access to an existing file.
75                </p>
76              </td>
77</tr>
78<tr>
79<td>
80                <p>
81                  <code class="computeroutput"><span class="identifier">scan</span></code>
82                </p>
83              </td>
84<td>
85                <p>
86                  Sequential read-only access to an existing file.
87                </p>
88              </td>
89</tr>
90<tr>
91<td>
92                <p>
93                  <code class="computeroutput"><span class="identifier">write</span></code>
94                </p>
95              </td>
96<td>
97                <p>
98                  Random reading and writing to a new or truncated file.
99                </p>
100                <p>
101                  This mode permits random-access reading and writing for the specified
102                  file. If the file does not exist prior to the function call, it
103                  is created with an initial size of zero bytes. Otherwise if the
104                  file already exists, the size is truncated to zero bytes.
105                </p>
106              </td>
107</tr>
108<tr>
109<td>
110                <p>
111                  <code class="computeroutput"><span class="identifier">write_new</span></code>
112                </p>
113              </td>
114<td>
115                <p>
116                  Random reading and writing to a new file only.
117                </p>
118                <p>
119                  This mode permits random-access reading and writing for the specified
120                  file. The file will be created with an initial size of zero bytes.
121                  If the file already exists prior to the function call, an error
122                  is returned and no file is opened.
123                </p>
124              </td>
125</tr>
126<tr>
127<td>
128                <p>
129                  <code class="computeroutput"><span class="identifier">write_existing</span></code>
130                </p>
131              </td>
132<td>
133                <p>
134                  Random write-only access to existing file.
135                </p>
136                <p>
137                  If the file does not exist, an error is generated.
138                </p>
139              </td>
140</tr>
141<tr>
142<td>
143                <p>
144                  <code class="computeroutput"><span class="identifier">append</span></code>
145                </p>
146              </td>
147<td>
148                <p>
149                  Appending to a new or truncated file.
150                </p>
151                <p>
152                  The current file position shall be set to the end of the file prior
153                  to each write.
154                </p>
155                <p>
156                  @li If the file does not exist, it is created.
157                </p>
158                <p>
159                  @li If the file exists, it is truncated to zero size upon opening.
160                </p>
161              </td>
162</tr>
163<tr>
164<td>
165                <p>
166                  <code class="computeroutput"><span class="identifier">append_existing</span></code>
167                </p>
168              </td>
169<td>
170                <p>
171                  Appending to an existing file.
172                </p>
173                <p>
174                  The current file position shall be set to the end of the file prior
175                  to each write.
176                </p>
177                <p>
178                  If the file does not exist, an error is generated.
179                </p>
180              </td>
181</tr>
182</tbody>
183</table></div>
184<h5>
185<a name="beast.ref.boost__beast__file_mode.h2"></a>
186        <span class="phrase"><a name="beast.ref.boost__beast__file_mode.description"></a></span><a class="link" href="boost__beast__file_mode.html#beast.ref.boost__beast__file_mode.description">Description</a>
187      </h5>
188<p>
189        These modes are used when opening files using instances of the <span class="emphasis"><em>File</em></span>
190        concept.
191      </p>
192<h5>
193<a name="beast.ref.boost__beast__file_mode.h3"></a>
194        <span class="phrase"><a name="beast.ref.boost__beast__file_mode.see_also"></a></span><a class="link" href="boost__beast__file_mode.html#beast.ref.boost__beast__file_mode.see_also">See
195        Also</a>
196      </h5>
197<p>
198        <a class="link" href="boost__beast__file_stdio.html" title="file_stdio"><code class="computeroutput"><span class="identifier">file_stdio</span></code></a>
199      </p>
200</div>
201<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
202<td align="left"></td>
203<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Vinnie
204      Falco<p>
205        Distributed under the Boost Software License, Version 1.0. (See accompanying
206        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
207      </p>
208</div></td>
209</tr></table>
210<hr>
211<div class="spirit-nav">
212<a accesskey="p" href="boost__beast__condition.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="boost__beast__role_type.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
213</div>
214</body>
215</html>
216