Home | Libraries | People | FAQ | More |
Asynchronous volume enumeration after a preceding operation.
Related types: statfs_t
future<statfs_t> async_statfs(future<> _precondition, fs_metadata_flags req)
Type |
Concept |
Name |
Description |
---|---|---|---|
future<> |
_precondition |
The precondition to use. |
|
fs_metadata_flags |
req |
A metadata request. |
A future<
statfs_t
>
#include <boost/afio/v2/afio.hpp>
Operating system | Race guarantees under a changing file system |
---|---|
FreeBSD, OS X | Race free. |
Linux | The following items are fetched in a single snapshot: bsize, iosize, blocks, bfree, bavail, files, ffree, namemax, fsid, flags.rdonly, flags.noexec, flags.nosuid. |
Windows | The following snapshot categories apply: (i) flags, namemax, fstypename (ii) bsize, blocks, bfree, bavail. Everything else is fetched separately. |
Amortised O(1) to dispatch. Amortised O(1) to complete.
Propagates the exception of any input precondition with an errored state
at the point of dispatch, and throws a std::invalid_argument
if any inputs have values which could not possibly be correct. Note that
error code returning functions may still throw exceptions e.g. failure
to allocate memory.
boost::afio::current_dispatcher_guard h(boost::afio::make_dispatcher().get()); // Open the root directory boost::afio::handle_ptr rootdir(boost::afio::dir("/")); // Ask the filing system of the root directory how much free space there is boost::afio::statfs_t statfs( boost::afio::statfs(rootdir, boost::afio::fs_metadata_flags::bsize | boost::afio::fs_metadata_flags::bfree)); std::cout << "Your root filing system has " << (statfs.f_bfree * statfs.f_bsize / 1024.0 / 1024.0 / 1024.0) << " Gb free." << std::endl;