Home | Libraries | People | FAQ | More |
std::shared_ptr<handle
>
(aliased as afio::handle_ptr
)
where handle
is an opaque
abstract base class. handle
may, or may not, refer to a currently open file descriptor/handle i.e.
it is possible to close it before the reference count reaches zero. You
can create your own custom implementations of handle
.
std::shared_ptr<dispatcher
>
(aliased as afio::dispatcher_ptr
) where dispatcher
is also an opaque abstract base class. When constructed using make_dispatcher()
you specify a URI such as file:///
which specifies what namespace the dispatcher will dispatch onto. You can
create your own custom dispatcher
implementations for some URI regex pattern too.
afio::future<T>
<T = void>
which always represents a future handle_ptr
plus an optional T
which is usually void
(hence defaulting T
to
void
). This custom future
type is implemented using Boost.Outcome's
lightweight monadic future factory toolkit, and therefore provides all
the C++ 1z Concurrency TS and Boost.Thread
extensions including continuations and wait composure. Note that lightweight
futures can carry an error_code
as well as an exception_ptr
,
and therefore much of the need for non-throwing error_code
taking API overloads is not needed (though any function not returning a
future still uses that idiom).
afio::path
which is a thin wrap
of your STL/Boost Filesystem path. This is done because on Microsoft Windows,
AFIO always uses NT kernel paths, never
Win32 paths. By skipping the Win32 translation layer one achieves significantly
better performance and much closer to POSIX semantics including case sensitivity,
plus there are no issues with path length limits. On Windows afio::path
(NT kernel paths) will usually auto
convert to and from filesystem::path
(Win32 paths), however do note there is not always a one to one mapping
from a NT kernel path to a Win32 path in which case the Win32 paths to
send in will never be the Win32 paths you get out. See the documentation
for path
.
Caution | |
---|---|
Until issue #79 is resolved, don't do directory enumerations from an x86 binary on a x64 Windows system. This is due to a bug in Microsoft's WOW64 syscall translation layer which Microsoft have decided is wontfix. |
Note | |
---|---|
Gathering error states from many futures at once is made easier using
the |
handle_ptr->close()
is a no-op. This is due to a performance feature called “directory
handle caching” which shares read-only directory handles amongst
all users unless specifically requested not to do so. You can test for
this using the available_to_directory_cache()
member function of handle
.
<32
chars of
random hex>.afiod
and ask the operating system to delete it later when the last handle is
closed. Any enumerations of directories containing these randomised named
files will omit those entries by default. This emulates POSIX semantics,
albeit imperfectly. One caveat is it cannot always do this with directories,
though it tries hard to try again later where it can. A future version
of AFIO will add tmpfs
support which will let us relocate troublesome directories into the temp
directory where they can be deleted much later, thus more closely matching
POSIX semantics still further.
Boost.AFIO version 1.4 provides the following operations:
Operation |
Asynchronous batch |
Synchronous |
Asynchronous free functions |
Synchronous free functions |
Related types |
---|---|---|---|---|---|
1 |
2 |
4 |
|||
1 |
2 |
4 |
|||
1 |
2 |
4 |
|||
1 |
2 |
4 |
|||
1 |
2 |
4 |
|||
1 |
2 |
4 |
|||
1 |
1 |
2 |
|||
1 |
1 |
2 |
|||
1 |
1 |
2 |
|||
1 |
2 |
4 |
|||
1 |
2 |
4 |
|||
1 |
1 |
2 |
|||
Enumerate directory
contents/ fetch file metadata: |
1 |
3 |
6 |
||
1 |
1 |
2 |
|||
1 |
1 |
2 |
|||
2 |
|||||
2 |
|||||
1 |
|||||
1 |
|||||
1 |
|||||
Unlink an open
fd/handle from its existing path (caution!): |
1 |
||||
1 |
Planned new operations coming next version of AFIO so you know what's coming next:
handle
's
with what locking to do per operation.
tmp://
URI backend for a temporary
file filesystem.