Boost.AFIO    Boost C++ Libraries
Functions
Enumerating directory contents

Functions

virtual std::vector< future
< std::pair< std::vector
< directory_entry >, bool > > > 
boost::afio::dispatcher::enumerate (const std::vector< enumerate_req > &reqs)=0
 Schedule a batch of asynchronous directory enumerations after preceding operations.
future< std::pair< std::vector
< directory_entry >, bool > > 
boost::afio::async_enumerate (future<> _precondition, size_t _maxitems=2, bool _restart=true, path _glob=path(), metadata_flags _metadata=metadata_flags::None, enumerate_req::filter _filtering=enumerate_req::filter::fastdeleted)
 Asynchronous directory enumeration after a preceding operation.
std::pair< std::vector
< directory_entry >, bool > 
boost::afio::enumerate (future<> _precondition, size_t _maxitems=2, bool _restart=true, path _glob=path(), metadata_flags _metadata=metadata_flags::None, enumerate_req::filter _filtering=enumerate_req::filter::fastdeleted)
 Synchronous directory enumeration after a preceding operation.
std::pair< std::vector
< directory_entry >, bool > 
boost::afio::enumerate (error_code &_ec, future<> _precondition, size_t _maxitems=2, bool _restart=true, path _glob=path(), metadata_flags _metadata=metadata_flags::None, enumerate_req::filter _filtering=enumerate_req::filter::fastdeleted)
 Synchronous directory enumeration after a preceding operation.
future< std::pair< std::vector
< directory_entry >, bool > > 
boost::afio::async_enumerate (future<> _precondition, path _glob, size_t _maxitems=2, bool _restart=true, metadata_flags _metadata=metadata_flags::None, enumerate_req::filter _filtering=enumerate_req::filter::fastdeleted)
 Asynchronous directory enumeration after a preceding operation.
std::pair< std::vector
< directory_entry >, bool > 
boost::afio::enumerate (future<> _precondition, path _glob, size_t _maxitems=2, bool _restart=true, metadata_flags _metadata=metadata_flags::None, enumerate_req::filter _filtering=enumerate_req::filter::fastdeleted)
 Synchronous directory enumeration after a preceding operation.
std::pair< std::vector
< directory_entry >, bool > 
boost::afio::enumerate (error_code &_ec, future<> _precondition, path _glob, size_t _maxitems=2, bool _restart=true, metadata_flags _metadata=metadata_flags::None, enumerate_req::filter _filtering=enumerate_req::filter::fastdeleted)
 Synchronous directory enumeration after a preceding operation.
future< std::pair< std::vector
< directory_entry >, bool > > 
boost::afio::async_enumerate (future<> _precondition, metadata_flags _metadata, size_t _maxitems=2, bool _restart=true, path _glob=path(), enumerate_req::filter _filtering=enumerate_req::filter::fastdeleted)
 Asynchronous directory enumeration after a preceding operation.
std::pair< std::vector
< directory_entry >, bool > 
boost::afio::enumerate (future<> _precondition, metadata_flags _metadata, size_t _maxitems=2, bool _restart=true, path _glob=path(), enumerate_req::filter _filtering=enumerate_req::filter::fastdeleted)
 Synchronous directory enumeration after a preceding operation.
std::pair< std::vector
< directory_entry >, bool > 
boost::afio::enumerate (error_code &_ec, future<> _precondition, metadata_flags _metadata, size_t _maxitems=2, bool _restart=true, path _glob=path(), enumerate_req::filter _filtering=enumerate_req::filter::fastdeleted)
 Synchronous directory enumeration after a preceding operation.

Function Documentation

future< std::pair< std::vector< directory_entry >, bool > > boost::afio::dispatcher::enumerate ( const std::vector< enumerate_req > &  reqs) [pure virtual]

Schedule a batch of asynchronous directory enumerations after preceding operations.

By default dir() returns shared handles i.e. dir( foo) and dir( foo) will return the exact same handle, and therefore enumerating not all of the entries at once is a race condition. The solution is to either set maxitems to a value large enough to guarantee a directory will be enumerated in a single shot, or to open a separate directory handle using the file_flags::unique_directory_handle flag.

Note that setting maxitems=1 will often cause a buffer space exhaustion, causing a second syscall with an enlarged buffer. This is because AFIO cannot know if the allocated buffer can hold all of the filename being retrieved, so it may have to retry. Put another way, setting maxitems=1 will give you the worst performance possible, whereas maxitems=2 will probably only return one item most of the time.

Related types: `__afio_enumerate_req__`, `__afio_directory_entry__`, `__afio_stat_t__`

Returns:
A batch of stl_future vectors of directory entries with boolean returning false if done.
Parameters:
reqsA batch of enumeration requests.
{ [raceguarantee FreeBSD, Linux, OS X..Race free per batch of up to ['maxitems] for ino and type only. Remember that many filing systems will recycle inodes such that a created file will get the inode of a just deleted file, so comparing inodes for equivalence to a direntry() won't help you.] [raceguarantee Windows..Race free per batch of up to ['maxitems] for ino, type, atim, mtim, ctim, size, allocated, birthtim, sparse, compressed.] }

Definition at line 3717 of file afio.hpp.

future<std::pair<std::vector<directory_entry>, bool> > boost::afio::async_enumerate ( future<>  _precondition,
size_t  _maxitems = 2,
bool  _restart = true,
path  _glob = path(),
metadata_flags  _metadata = metadata_flags::None,
enumerate_req::filter  _filtering = enumerate_req::filter::fastdeleted 
)

Asynchronous directory enumeration after a preceding operation.

Returns:
A `future<std::pair<std::vector<directory_entry>, bool>>`
Parameters:
_preconditionThe precondition to use.
_maxitemsThe maximum number of items to return in this request. Note that setting to one will often invoke two syscalls.
_restartRestarts the enumeration for this open directory handle.
_globAn optional shell glob by which to filter the items returned. Done kernel side on Windows, user side on POSIX.
_metadataThe metadata to prefetch for each item enumerated. AFIO may fetch more metadata than requested if it is cost free.
_filteringAny filtering you want AFIO to do for you.

{distinguish, maxitems first} { [raceguarantee FreeBSD, Linux, OS X..Race free per batch of up to ['maxitems] for ino and type only. Remember that many filing systems will recycle inodes such that a created file will get the inode of a just deleted file, so comparing inodes for equivalence to a direntry() won't help you.] [raceguarantee Windows..Race free per batch of up to ['maxitems] for ino, type, atim, mtim, ctim, size, allocated, birthtim, sparse, compressed.] } {Amortised O(1) to dispatch. Amortised O(M) to complete where M is the average number of entries in each directory.} {enumerate_example}

Definition at line 5333 of file afio.hpp.

std::pair<std::vector<directory_entry>, bool> boost::afio::enumerate ( future<>  _precondition,
size_t  _maxitems = 2,
bool  _restart = true,
path  _glob = path(),
metadata_flags  _metadata = metadata_flags::None,
enumerate_req::filter  _filtering = enumerate_req::filter::fastdeleted 
)

Synchronous directory enumeration after a preceding operation.

Returns:
A vector of results and a bool indicating if there is more.
Parameters:
_preconditionThe precondition to use.
_maxitemsThe maximum number of items to return in this request. Note that setting to one will often invoke two syscalls.
_restartRestarts the enumeration for this open directory handle.
_globAn optional shell glob by which to filter the items returned. Done kernel side on Windows, user side on POSIX.
_metadataThe metadata to prefetch for each item enumerated. AFIO may fetch more metadata than requested if it is cost free.
_filteringAny filtering you want AFIO to do for you.

{distinguish, max items first throwing} { [raceguarantee FreeBSD, Linux, OS X..Race free per batch of up to ['maxitems] for ino and type only. Remember that many filing systems will recycle inodes such that a created file will get the inode of a just deleted file, so comparing inodes for equivalence to a direntry() won't help you.] [raceguarantee Windows..Race free per batch of up to ['maxitems] for ino, type, atim, mtim, ctim, size, allocated, birthtim, sparse, compressed.] } {Amortised O(1) to dispatch. Amortised O(M) to complete where M is the average number of entries in each directory.} {enumerate_example}

Definition at line 5362 of file afio.hpp.

std::pair<std::vector<directory_entry>, bool> boost::afio::enumerate ( error_code &  _ec,
future<>  _precondition,
size_t  _maxitems = 2,
bool  _restart = true,
path  _glob = path(),
metadata_flags  _metadata = metadata_flags::None,
enumerate_req::filter  _filtering = enumerate_req::filter::fastdeleted 
)

Synchronous directory enumeration after a preceding operation.

Returns:
A vector of results and a bool indicating if there is more.
Parameters:
_ecError code to set.
_preconditionThe precondition to use.
_maxitemsThe maximum number of items to return in this request. Note that setting to one will often invoke two syscalls.
_restartRestarts the enumeration for this open directory handle.
_globAn optional shell glob by which to filter the items returned. Done kernel side on Windows, user side on POSIX.
_metadataThe metadata to prefetch for each item enumerated. AFIO may fetch more metadata than requested if it is cost free.
_filteringAny filtering you want AFIO to do for you.

{distinguish, max items first non throwing} { [raceguarantee FreeBSD, Linux, OS X..Race free per batch of up to ['maxitems] for ino and type only. Remember that many filing systems will recycle inodes such that a created file will get the inode of a just deleted file, so comparing inodes for equivalence to a direntry() won't help you.] [raceguarantee Windows..Race free per batch of up to ['maxitems] for ino, type, atim, mtim, ctim, size, allocated, birthtim, sparse, compressed.] } {Amortised O(1) to dispatch. Amortised O(M) to complete where M is the average number of entries in each directory.} {enumerate_example}

Definition at line 5392 of file afio.hpp.

future<std::pair<std::vector<directory_entry>, bool> > boost::afio::async_enumerate ( future<>  _precondition,
path  _glob,
size_t  _maxitems = 2,
bool  _restart = true,
metadata_flags  _metadata = metadata_flags::None,
enumerate_req::filter  _filtering = enumerate_req::filter::fastdeleted 
)

Asynchronous directory enumeration after a preceding operation.

Returns:
A `future<std::pair<std::vector<directory_entry>, bool>>`
Parameters:
_preconditionThe precondition to use.
_globA shell glob by which to filter the items returned. Done kernel side on Windows, user side on POSIX.
_maxitemsThe maximum number of items to return in this request. Note that setting to one will often invoke two syscalls.
_restartRestarts the enumeration for this open directory handle.
_metadataThe metadata to prefetch for each item enumerated. AFIO may fetch more metadata than requested if it is cost free.
_filteringAny filtering you want AFIO to do for you.

{distinguish, glob first} { [raceguarantee FreeBSD, Linux, OS X..Race free per batch of up to ['maxitems] for ino and type only. Remember that many filing systems will recycle inodes such that a created file will get the inode of a just deleted file, so comparing inodes for equivalence to a direntry() won't help you.] [raceguarantee Windows..Race free per batch of up to ['maxitems] for ino, type, atim, mtim, ctim, size, allocated, birthtim, sparse, compressed.] } {Amortised O(1) to dispatch. Amortised O(M) to complete where M is the average number of entries in each directory.} {enumerate_example}

Definition at line 5424 of file afio.hpp.

std::pair<std::vector<directory_entry>, bool> boost::afio::enumerate ( future<>  _precondition,
path  _glob,
size_t  _maxitems = 2,
bool  _restart = true,
metadata_flags  _metadata = metadata_flags::None,
enumerate_req::filter  _filtering = enumerate_req::filter::fastdeleted 
)

Synchronous directory enumeration after a preceding operation.

Returns:
A vector of results and a bool indicating if there is more.
Parameters:
_preconditionThe precondition to use.
_globA shell glob by which to filter the items returned. Done kernel side on Windows, user side on POSIX.
_maxitemsThe maximum number of items to return in this request. Note that setting to one will often invoke two syscalls.
_restartRestarts the enumeration for this open directory handle.
_metadataThe metadata to prefetch for each item enumerated. AFIO may fetch more metadata than requested if it is cost free.
_filteringAny filtering you want AFIO to do for you.

{distinguish, glob first throwing} { [raceguarantee FreeBSD, Linux, OS X..Race free per batch of up to ['maxitems] for ino and type only. Remember that many filing systems will recycle inodes such that a created file will get the inode of a just deleted file, so comparing inodes for equivalence to a direntry() won't help you.] [raceguarantee Windows..Race free per batch of up to ['maxitems] for ino, type, atim, mtim, ctim, size, allocated, birthtim, sparse, compressed.] } {Amortised O(1) to dispatch. Amortised O(M) to complete where M is the average number of entries in each directory.} {enumerate_example}

Definition at line 5453 of file afio.hpp.

std::pair<std::vector<directory_entry>, bool> boost::afio::enumerate ( error_code &  _ec,
future<>  _precondition,
path  _glob,
size_t  _maxitems = 2,
bool  _restart = true,
metadata_flags  _metadata = metadata_flags::None,
enumerate_req::filter  _filtering = enumerate_req::filter::fastdeleted 
)

Synchronous directory enumeration after a preceding operation.

Returns:
A vector of results and a bool indicating if there is more.
Parameters:
_ecError code to set.
_preconditionThe precondition to use.
_globA shell glob by which to filter the items returned. Done kernel side on Windows, user side on POSIX.
_maxitemsThe maximum number of items to return in this request. Note that setting to one will often invoke two syscalls.
_restartRestarts the enumeration for this open directory handle.
_metadataThe metadata to prefetch for each item enumerated. AFIO may fetch more metadata than requested if it is cost free.
_filteringAny filtering you want AFIO to do for you.

{distinguish, glob first non throwing} { [raceguarantee FreeBSD, Linux, OS X..Race free per batch of up to ['maxitems] for ino and type only. Remember that many filing systems will recycle inodes such that a created file will get the inode of a just deleted file, so comparing inodes for equivalence to a direntry() won't help you.] [raceguarantee Windows..Race free per batch of up to ['maxitems] for ino, type, atim, mtim, ctim, size, allocated, birthtim, sparse, compressed.] } {Amortised O(1) to dispatch. Amortised O(M) to complete where M is the average number of entries in each directory.} {enumerate_example}

Definition at line 5483 of file afio.hpp.

future<std::pair<std::vector<directory_entry>, bool> > boost::afio::async_enumerate ( future<>  _precondition,
metadata_flags  _metadata,
size_t  _maxitems = 2,
bool  _restart = true,
path  _glob = path(),
enumerate_req::filter  _filtering = enumerate_req::filter::fastdeleted 
)

Asynchronous directory enumeration after a preceding operation.

Returns:
A `future<std::pair<std::vector<directory_entry>, bool>>`
Parameters:
_preconditionThe precondition to use.
_metadataThe metadata to prefetch for each item enumerated. AFIO may fetch more metadata than requested if it is cost free.
_maxitemsThe maximum number of items to return in this request. Note that setting to one will often invoke two syscalls.
_restartRestarts the enumeration for this open directory handle.
_globAn optional shell glob by which to filter the items returned. Done kernel side on Windows, user side on POSIX.
_filteringAny filtering you want AFIO to do for you.

{distinguish, metadata first} { [raceguarantee FreeBSD, Linux, OS X..Race free per batch of up to ['maxitems] for ino and type only. Remember that many filing systems will recycle inodes such that a created file will get the inode of a just deleted file, so comparing inodes for equivalence to a direntry() won't help you.] [raceguarantee Windows..Race free per batch of up to ['maxitems] for ino, type, atim, mtim, ctim, size, allocated, birthtim, sparse, compressed.] } {Amortised O(1) to dispatch. Amortised O(M) to complete where M is the average number of entries in each directory.} {enumerate_example}

Definition at line 5515 of file afio.hpp.

std::pair<std::vector<directory_entry>, bool> boost::afio::enumerate ( future<>  _precondition,
metadata_flags  _metadata,
size_t  _maxitems = 2,
bool  _restart = true,
path  _glob = path(),
enumerate_req::filter  _filtering = enumerate_req::filter::fastdeleted 
)

Synchronous directory enumeration after a preceding operation.

Returns:
A vector of results and a bool indicating if there is more.
Parameters:
_preconditionThe precondition to use.
_metadataThe metadata to prefetch for each item enumerated. AFIO may fetch more metadata than requested if it is cost free.
_maxitemsThe maximum number of items to return in this request. Note that setting to one will often invoke two syscalls.
_restartRestarts the enumeration for this open directory handle.
_globAn optional shell glob by which to filter the items returned. Done kernel side on Windows, user side on POSIX.
_filteringAny filtering you want AFIO to do for you.

{distinguish, metadata first throwing} { [raceguarantee FreeBSD, Linux, OS X..Race free per batch of up to ['maxitems] for ino and type only. Remember that many filing systems will recycle inodes such that a created file will get the inode of a just deleted file, so comparing inodes for equivalence to a direntry() won't help you.] [raceguarantee Windows..Race free per batch of up to ['maxitems] for ino, type, atim, mtim, ctim, size, allocated, birthtim, sparse, compressed.] } {Amortised O(1) to dispatch. Amortised O(M) to complete where M is the average number of entries in each directory.} {enumerate_example}

Definition at line 5544 of file afio.hpp.

std::pair<std::vector<directory_entry>, bool> boost::afio::enumerate ( error_code &  _ec,
future<>  _precondition,
metadata_flags  _metadata,
size_t  _maxitems = 2,
bool  _restart = true,
path  _glob = path(),
enumerate_req::filter  _filtering = enumerate_req::filter::fastdeleted 
)

Synchronous directory enumeration after a preceding operation.

Returns:
A vector of results and a bool indicating if there is more.
Parameters:
_ecError code to set.
_preconditionThe precondition to use.
_metadataThe metadata to prefetch for each item enumerated. AFIO may fetch more metadata than requested if it is cost free.
_maxitemsThe maximum number of items to return in this request. Note that setting to one will often invoke two syscalls.
_restartRestarts the enumeration for this open directory handle.
_globAn optional shell glob by which to filter the items returned. Done kernel side on Windows, user side on POSIX.
_filteringAny filtering you want AFIO to do for you.

{distinguish, metadata first non throwing} { [raceguarantee FreeBSD, Linux, OS X..Race free per batch of up to ['maxitems] for ino and type only. Remember that many filing systems will recycle inodes such that a created file will get the inode of a just deleted file, so comparing inodes for equivalence to a direntry() won't help you.] [raceguarantee Windows..Race free per batch of up to ['maxitems] for ino, type, atim, mtim, ctim, size, allocated, birthtim, sparse, compressed.] } {Amortised O(1) to dispatch. Amortised O(M) to complete where M is the average number of entries in each directory.} {enumerate_example}

Definition at line 5574 of file afio.hpp.


January, 2014

Copyright © 2013-2014 Niall Douglas, Cork, Ireland
Copyright © 2013 Paul Kirth, California
Documentation is generated by Doxygen