boost::corosio::stream_file::release

Release ownership of the native handle.

Synopsis

Description

The file object becomes not‐open. The caller is responsible for closing the returned handle.

release() cancels pending operations first. On Windows, the object keeps the handle and this throws if one is still in flight. It does the same if Windows refuses to detach the handle from the execution context's completion port. Call release() again once the cancelled operations have completed. Detaching requires Windows 8.1 or later.

Exceptions

Name

Thrown on

std::system_error

errc::bad_file_descriptor if the file is not open. On Windows, errc::device_or_resource_busy if an operation is still in flight, or errc::operation_not_supported if the handle cannot be detached.

Return Value

The native file descriptor or handle.

Created with MrDocs