Writes a sequence of buffers to a file.
- Example
const char d2[] = "Hello World!\n";
asio::buffer(d1),
asio::buffer(d2, std::size(d2) - 1),
asio::buffer(d3)
};
◆ write_file() [1/6]
template<class ConstBufferSequence >
Write a sequence of buffers to a file.
This function writes buffers
into filename
. If the file already exists, it is overwritten. After a successful call to this function, the file shall only contain the contents of the given buffers.
- Parameters
-
filename | The path of the file into which the buffer content shall be written. |
buffers | The sequence of buffers to write to the file. |
- Exceptions
-
asio::system_error | Thrown on failure. |
◆ write_file() [2/6]
template<class ConstBufferSequence >
Write a sequence of buffers to a file.
This function writes buffers
into filename
. If the file already exists, it is overwritten. After a successful call to this function, the file shall only contain the contents of the given buffers.
- Parameters
-
filename | The path of the file into which the buffer content shall be written. |
buffers | The sequence of buffers to write to the file. |
ec | Set to indicate what error occurred. If no error occurred, the object is reset. |
◆ write_file() [3/6]
template<class ConstBufferSequence >
Write a sequence of buffers to a file.
This function writes buffers
into filename
. If the file already exists, it is overwritten. After a successful call to this function, the file shall only contain the contents of the given buffers.
- Parameters
-
filename | The path of the file into which the buffer content shall be written. |
buffers | The sequence of buffers to write to the file. |
- Exceptions
-
asio::system_error | Thrown on failure. |
- Note
- Only available on Windows.
◆ write_file() [4/6]
template<class ConstBufferSequence >
Write a sequence of buffers to a file.
This function writes buffers
into filename
. If the file already exists, it is overwritten. After a successful call to this function, the file shall only contain the contents of the given buffers.
- Parameters
-
filename | The path of the file into which the buffer content shall be written. |
buffers | The sequence of buffers to write to the file. |
ec | Set to indicate what error occurred. If no error occurred, the object is reset. |
- Note
- Only available on Windows.
◆ write_file() [5/6]
template<class ConstBufferSequence >
void asioext::write_file |
( |
const boost::filesystem::path & |
filename, |
|
|
const ConstBufferSequence & |
buffers |
|
) |
| |
Write a sequence of buffers to a file.
This function writes buffers
into filename
. If the file already exists, it is overwritten. After a successful call to this function, the file shall only contain the contents of the given buffers.
- Parameters
-
filename | The path of the file into which the buffer content shall be written. |
buffers | The sequence of buffers to write to the file. |
- Exceptions
-
asio::system_error | Thrown on failure. |
- Note
- Only available if using Boost.Filesystem (i.e. if
ASIOEXT_HAS_BOOST_FILESYSTEM
is defined)
◆ write_file() [6/6]
template<class ConstBufferSequence >
Write a sequence of buffers to a file.
This function writes buffers
into filename
. If the file already exists, it is overwritten. After a successful call to this function, the file shall only contain the contents of the given buffers.
- Parameters
-
filename | The path of the file into which the buffer content shall be written. |
buffers | The sequence of buffers to write to the file. |
ec | Set to indicate what error occurred. If no error occurred, the object is reset. |
- Note
- Only available if using Boost.Filesystem (i.e. if
ASIOEXT_HAS_BOOST_FILESYSTEM
is defined)