Home | Libraries | People | FAQ | More |
Schedule a batch of asynchronous volume enumerations after preceding operations.
Related types: statfs_t
future< statfs_t > dispatcher::statfs(const std::vector< future<>> & ops, const std::vector< fs_metadata_flags > & reqs)
Type |
Concept |
Name |
Description |
---|---|---|---|
const std::vector< future<>> & |
ops |
A batch of op handles. |
|
const std::vector< fs_metadata_flags > & |
reqs |
A batch of metadata requests. |
A batch of stl_future volume metadatas.
#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(N) to dispatch. Amortised O(N/threadpool*M) to complete where M is the average number of entries in each directory.
Propagates exceptions of any input preconditions 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. Once a
batch of input ops has been verified at the point of entry as not errored,
you are guaranteed that the batch is atomically scheduled as a whole,
unless a failure to allocate memory occurs.
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;