Open a handle to a file.
More...
|
unique_file_handle | asioext::open (const char *filename, open_flags flags, file_perms perms=file_perms::create_default, file_attrs attrs=file_attrs::none) |
| Open a file and return its handle. More...
|
|
unique_file_handle | asioext::open (const char *filename, open_flags flags, file_perms perms, file_attrs attrs, error_code &ec) noexcept |
| Open a file and return its handle. More...
|
|
unique_file_handle | asioext::open (const wchar_t *filename, open_flags flags, file_perms perms=file_perms::create_default, file_attrs attrs=file_attrs::none) |
| Open a file and return its handle. More...
|
|
unique_file_handle | asioext::open (const wchar_t *filename, open_flags flags, file_perms perms, file_attrs attrs, error_code &ec) noexcept |
| Open a file and return its handle. More...
|
|
unique_file_handle | asioext::open (const boost::filesystem::path &filename, open_flags flags, file_perms perms=file_perms::create_default, file_attrs attrs=file_attrs::none) |
| Open a file and return its handle. More...
|
|
unique_file_handle | asioext::open (const boost::filesystem::path &filename, open_flags flags, file_perms perms, file_attrs attrs, error_code &ec) noexcept |
| Open a file and return its handle. More...
|
|
Open a handle to a file.
◆ open() [1/6]
Open a file and return its handle.
This function opens the specified file and returns a handle to it.
- Parameters
-
filename | The path of the file to open. See Filenames for details. |
flags | Flags used to open the file. For a detailed reference, see asioext::open_flags. |
perms | Permissions for newly created files. Unused if an existing file is opened. Defaults to file_perms::create_default. |
attrs | Attributes for newly created files. Unused if an existing file is opened. Defaults to file_attrs::none. |
- Returns
- A handle to the opened file. Ownership is transferred to the caller. Handles are not inherited by child processes.
- Exceptions
-
asio::system_error | Thrown on failure. |
- See also
- open_flags
-
Filenames
◆ open() [2/6]
Open a file and return its handle.
This function attempts to open the specified file. If successful, the returned file_handle will contain the handle of the opened file. Otherwise the file_handle will be empty.
- Parameters
-
filename | The path of the file to open. See Filenames for details. |
flags | Flags used to open the file. For a detailed reference, see asioext::open_flags. |
perms | Permissions for newly created files. Unused if an existing file is opened. Defaults to file_perms::create_default. |
attrs | Attributes for newly created files. Unused if an existing file is opened. Defaults to file_attrs::none. |
ec | Set to indicate what error occurred. If no error occurred, the object is reset. |
- Returns
- A handle to the opened file (or an empty handle in case of failure). Ownership is transferred to the caller. Handles are not inherited by child processes.
- See also
- open_flags
-
Filenames
◆ open() [3/6]
Open a file and return its handle.
This function opens the specified file and returns a handle to it.
- Parameters
-
filename | The path of the file to open. See Filenames for details. |
flags | Flags used to open the file. For a detailed reference, see asioext::open_flags. |
perms | Permissions for newly created files. Unused if an existing file is opened. Defaults to file_perms::create_default. |
attrs | Attributes for newly created files. Unused if an existing file is opened. Defaults to file_attrs::none. |
- Returns
- A handle to the opened file. Ownership is transferred to the caller. Handles are not inherited by child processes.
- Exceptions
-
asio::system_error | Thrown on failure. |
- See also
- open_flags
-
Filenames
- Note
- Only available on Windows.
◆ open() [4/6]
Open a file and return its handle.
This function attempts to open the specified file. If successful, the returned file_handle will contain the handle of the opened file. Otherwise the file_handle will be empty.
- Parameters
-
filename | The path of the file to open. See Filenames for details. |
flags | Flags used to open the file. For a detailed reference, see asioext::open_flags. |
perms | Permissions for newly created files. Unused if an existing file is opened. Defaults to file_perms::create_default. |
attrs | Attributes for newly created files. Unused if an existing file is opened. Defaults to file_attrs::none. |
ec | Set to indicate what error occurred. If no error occurred, the object is reset. |
- Returns
- A handle to the opened file (or an empty handle in case of failure). Ownership is transferred to the caller. Handles are not inherited by child processes.
- See also
- open_flags
-
Filenames
- Note
- Only available on Windows.
◆ open() [5/6]
Open a file and return its handle.
This function opens the specified file and returns a handle to it.
- Parameters
-
filename | The path of the file to open. See Filenames for details. |
flags | Flags used to open the file. For a detailed reference, see asioext::open_flags. |
perms | Permissions for newly created files. Unused if an existing file is opened. Defaults to file_perms::create_default. |
attrs | Attributes for newly created files. Unused if an existing file is opened. Defaults to file_attrs::none. |
- Returns
- A handle to the opened file. Ownership is transferred to the caller. Handles are not inherited by child processes.
- Exceptions
-
asio::system_error | Thrown on failure. |
- See also
- open_flags
-
Filenames
- Note
- Only available if using Boost.Filesystem (i.e. if
ASIOEXT_HAS_BOOST_FILESYSTEM
is defined)
◆ open() [6/6]
Open a file and return its handle.
This function attempts to open the specified file. If successful, the returned file_handle will contain the handle of the opened file. Otherwise the file_handle will be empty.
- Parameters
-
filename | The path of the file to open. See Filenames for details. |
flags | Flags used to open the file. For a detailed reference, see asioext::open_flags. |
perms | Permissions for newly created files. Unused if an existing file is opened. Defaults to file_perms::create_default. |
attrs | Attributes for newly created files. Unused if an existing file is opened. Defaults to file_attrs::none. |
ec | Set to indicate what error occurred. If no error occurred, the object is reset. |
- Returns
- A handle to the opened file (or an empty handle in case of failure). Ownership is transferred to the caller. Handles are not inherited by child processes.
- See also
- open_flags
-
Filenames
- Note
- Only available if using Boost.Filesystem (i.e. if
ASIOEXT_HAS_BOOST_FILESYSTEM
is defined)