Boost.AFIO    Boost C++ Libraries
Functions
Deleting Files

Functions

virtual std::vector< future<> > boost::afio::dispatcher::rmfile (const std::vector< path_req > &reqs)=0
 Schedule a batch of asynchronous file deletions after optional preconditions.
template<class T = path>
future boost::afio::async_rmfile (future<> _precondition, T _path=path(), file_flags _flags=file_flags::none)
 Asynchronous file deletion after an optional precondition.
template<class T , typename = typename std::enable_if<detail::is_not_handle<T>::value>::type>
future boost::afio::async_rmfile (T _path, file_flags _flags=file_flags::none)
 Asynchronous file deletion after an optional precondition.
template<class T = path>
void boost::afio::rmfile (future<> _precondition, T _path=path(), file_flags _flags=file_flags::none)
 Synchronous file deletion after an optional precondition.
template<class T , typename = typename std::enable_if<detail::is_not_handle<T>::value>::type>
void boost::afio::rmfile (T _path, file_flags _flags=file_flags::none)
 Synchronous file deletion after an optional precondition.
template<class T = path>
void boost::afio::rmfile (error_code &_ec, future<> _precondition, T _path=path(), file_flags _flags=file_flags::none)
 Synchronous file deletion after an optional precondition.
template<class T , typename = typename std::enable_if<detail::is_not_handle<T>::value>::type>
void boost::afio::rmfile (error_code &_ec, T _path, file_flags _flags=file_flags::none)
 Synchronous file deletion after an optional precondition.

Function Documentation

future boost::afio::dispatcher::rmfile ( const std::vector< path_req > &  reqs) [pure virtual]

Schedule a batch of asynchronous file deletions after optional preconditions.

Note that you can delete files before they are closed on Windows just as with POSIX if and only if all open handles to that file were opened with permission for the file to be deleted (AFIO always sets this). The actual file data will be deleted when the last handle is closed on the system.

Make sure you read the docs for `__afio_handle__::unlink()` for important caveats.

Note that on operating systems with an unstable `__afio_handle__::path(true)` you need to be cautious of deleting files by handle as any hard link to that file may be deleted instead of the one you intended. To work around this, portable code should delete by directory handle as the precondition and known leafname.

Related types: `__afio_path_req__` Be aware that on Windows AFIO operates exclusively in the NT kernel namespace, NOT the Win32 namespace, and therefore paths you supply are converted by `afio::path` in NT kernel namespace paths. `normalise_path()` can convert an afio path back to a Filesystem TS path for you, but note that this may not be the path that was supplied originally. NT kernel namespace paths have a 32,767 character limit and an almost POSIX like lack of restrictions on naming or historical behaviour quirks, but as a result AFIO does not support DOS short names or any of the other historical Win32 filing system baggage.

Returns:
A batch of op handles.
Parameters:
reqsA batch of `path_req` structures.
{ [raceguarantee FreeBSD, Linux..Race free up to the containing directory.] [raceguarantee Windows..Race free if handle open, else up to the containing directory.] [raceguarantee OS X..No guarantees.] }

Definition at line 3630 of file afio.hpp.

template<class T = path>
future boost::afio::async_rmfile ( future<>  _precondition,
_path = path(),
file_flags  _flags = file_flags::none 
)

Asynchronous file deletion after an optional precondition.

Template Parameters:
class TThe type of path to be used.
Returns:
A future<void>
Parameters:
_preconditionThe precondition to use.
_pathThe filing system path to be used.
_flagsThe flags to be used.

{distinguish, relative} { [raceguarantee FreeBSD, Linux..Race free up to the containing directory.] [raceguarantee Windows..Race free if handle open, else up to the containing directory.] [raceguarantee OS X..No guarantees.] } {Amortised O(1) to dispatch. Amortised O(1) to complete if file deletion is constant time.} {filedir_example}

Definition at line 4458 of file afio.hpp.

template<class T , typename = typename std::enable_if<detail::is_not_handle<T>::value>::type>
future boost::afio::async_rmfile ( _path,
file_flags  _flags = file_flags::none 
)

Asynchronous file deletion after an optional precondition.

Template Parameters:
class TThe type of path to be used.
Returns:
A future<void>
Parameters:
_pathThe filing system path to be used.
_flagsThe flags to be used.

{distinguish, absolute} { [raceguarantee FreeBSD, Linux, OS X, Windows..No guarantees.] } {Amortised O(1) to dispatch. Amortised O(1) to complete if file deletion is constant time.} {filedir_example}

Definition at line 4480 of file afio.hpp.

template<class T = path>
void boost::afio::rmfile ( future<>  _precondition,
_path = path(),
file_flags  _flags = file_flags::none 
)

Synchronous file deletion after an optional precondition.

Template Parameters:
class TThe type of path to be used.
Parameters:
_preconditionThe precondition to use.
_pathThe filing system path to be used.
_flagsThe flags to be used.

{distinguish, relative throwing} { [raceguarantee FreeBSD, Linux..Race free up to the containing directory.] [raceguarantee Windows..Race free if handle open, else up to the containing directory.] [raceguarantee OS X..No guarantees.] } {Amortised O(1) to dispatch. Amortised O(1) to complete if file deletion is constant time.} {filedir_example}

Definition at line 4504 of file afio.hpp.

template<class T , typename = typename std::enable_if<detail::is_not_handle<T>::value>::type>
void boost::afio::rmfile ( _path,
file_flags  _flags = file_flags::none 
)

Synchronous file deletion after an optional precondition.

Template Parameters:
class TThe type of path to be used.
Parameters:
_pathThe filing system path to be used.
_flagsThe flags to be used.

{distinguish, absolute throwing} { [raceguarantee FreeBSD, Linux, OS X, Windows..No guarantees.] } {Amortised O(1) to dispatch. Amortised O(1) to complete if file deletion is constant time.} {filedir_example}

Definition at line 4525 of file afio.hpp.

template<class T = path>
void boost::afio::rmfile ( error_code &  _ec,
future<>  _precondition,
_path = path(),
file_flags  _flags = file_flags::none 
)

Synchronous file deletion after an optional precondition.

Template Parameters:
class TThe type of path to be used.
Parameters:
_ecError code to set.
_preconditionThe precondition to use.
_pathThe filing system path to be used.
_flagsThe flags to be used.

{distinguish, relative non throwing} { [raceguarantee FreeBSD, Linux..Race free up to the containing directory.] [raceguarantee Windows..Race free if handle open, else up to the containing directory.] [raceguarantee OS X..No guarantees.] } {Amortised O(1) to dispatch. Amortised O(1) to complete if file deletion is constant time.} {filedir_example}

Definition at line 4550 of file afio.hpp.

template<class T , typename = typename std::enable_if<detail::is_not_handle<T>::value>::type>
void boost::afio::rmfile ( error_code &  _ec,
_path,
file_flags  _flags = file_flags::none 
)

Synchronous file deletion after an optional precondition.

Template Parameters:
class TThe type of path to be used.
Parameters:
_ecError code to set.
_pathThe filing system path to be used.
_flagsThe flags to be used.

{distinguish, absolute non throwing} { [raceguarantee FreeBSD, Linux, OS X, Windows..No guarantees.] } {Amortised O(1) to dispatch. Amortised O(1) to complete if file deletion is constant time.} {filedir_example}

Definition at line 4572 of file afio.hpp.


January, 2014

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