3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
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__file/write.html" title="file::write">
10 <link rel="next" href="boost__beast__file_posix.html" title="file_posix">
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>
22 <div class="spirit-nav">
23 <a accesskey="p" href="boost__beast__file/write.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__file_posix.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
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>
30 <a class="indexterm" name="idm45873510709264"></a>
34 <a name="beast.ref.boost__beast__file_mode.h0"></a>
35 <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 Defined in header <code class="literal"><<a href="../../../../../../boost/beast/core/file_base.hpp" target="_top">boost/beast/core/file_base.hpp</a>></code>
40 <pre class="programlisting"><span class="keyword">enum</span> <span class="identifier">file_mode</span>
43 <a class="indexterm" name="idm45873510701264"></a>
44 <a class="indexterm" name="idm45873510700160"></a>
45 <a class="indexterm" name="idm45873510699056"></a>
46 <a class="indexterm" name="idm45873510697952"></a>
47 <a class="indexterm" name="idm45873510696848"></a>
48 <a class="indexterm" name="idm45873510695744"></a>
49 <a class="indexterm" name="idm45873510694640"></a>
53 <a name="beast.ref.boost__beast__file_mode.h1"></a>
54 <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>
56 <div class="informaltable"><table class="table">
77 <code class="literal">read</code>
82 Random read-only access to an existing file.
89 <code class="literal">scan</code>
94 Sequential read-only access to an existing file.
101 <code class="literal">write</code>
106 Random reading and writing to a new or truncated file.
109 This mode permits random-access reading and writing for the specified
110 file. If the file does not exist prior to the function call, it
111 is created with an initial size of zero bytes. Otherwise if the
112 file already exists, the size is truncated to zero bytes.
119 <code class="literal">write_new</code>
124 Random reading and writing to a new file only.
127 This mode permits random-access reading and writing for the specified
128 file. The file will be created with an initial size of zero bytes.
129 If the file already exists prior to the function call, an error
130 is returned and no file is opened.
137 <code class="literal">write_existing</code>
142 Random write-only access to existing file.
145 If the file does not exist, an error is generated.
152 <code class="literal">append</code>
157 Appending to a new or truncated file.
160 The current file position shall be set to the end of the file prior
164 @li If the file does not exist, it is created.
167 @li If the file exists, it is truncated to zero size upon opening.
174 <code class="literal">append_existing</code>
179 Appending to an existing file.
182 The current file position shall be set to the end of the file prior
186 If the file does not exist, an error is generated.
193 <a name="beast.ref.boost__beast__file_mode.h2"></a>
194 <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>
197 These modes are used when opening files using instances of the <span class="emphasis"><em>File</em></span>
201 <a name="beast.ref.boost__beast__file_mode.h3"></a>
202 <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
206 <a class="link" href="boost__beast__file_stdio.html" title="file_stdio"><code class="computeroutput"><span class="identifier">file_stdio</span></code></a>
209 Convenience header <code class="literal"><<a href="../../../../../../boost/beast/core.hpp" target="_top">boost/beast/core.hpp</a>></code>
212 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
213 <td align="left"></td>
214 <td align="right"><div class="copyright-footer">Copyright © 2016-2019 Vinnie
216 Distributed under the Boost Software License, Version 1.0. (See accompanying
217 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>)
222 <div class="spirit-nav">
223 <a accesskey="p" href="boost__beast__file/write.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__file_posix.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>