Aegis implements transactions defining two operation queues, one is used to store operations to be run at commit time and the other is used to store operations to be run at rollback time.
Operations to be run at commit time must be requested calling commit_* functions, while operations to be run at rollback time must be requested with undo_* functions.
Note that operation requested with commit_/undo_ functions are not executed immediatly but are delayed until the proper event (commit or undo) is issued. Also note that it is possible that the operation you request (e.g. commit_rename) will not be executed because an undo event is triggered, the same holds for undo_ operation.
void commit | ( | void | ) |
The commit function is used to perform all the actions queued using the commit_* functions.
After it has completed successfully, further calls to commit() will be NOPs, until new commit_* functions are used.
When the commit has succeeded, the undo list is cancelled, since there is now no reason to undo anything.
The commit_hard_link function is used to submit a commit request to hard link a file at commit (success) time.
from | path of file now | |
to | path of hard link to create at commit time. |
The commit_hard_link function is used to submit a commit request to hard link a file at commit (success) time.
from | path of file now | |
to | path of hard link to create at commit time. |
The commit_rename function is used to submit a commit request to rename a file.
from | path of file now | |
to | path of file after commit |
The commit_rename function is used to submit a commit request to rename a file.
from | path of file now | |
to | path of file after commit |
void commit_rmdir_errok | ( | const nstring & | path | ) |
The commit_rmdir_errok function is used to delete an empty directory on commit. It will not be an error if the directory does not exist. It will not be an error if the directory is not empty.
path | path of directory to be deleted |
void commit_rmdir_errok | ( | string_ty * | path | ) |
The commit_rmdir_errok function is used to delete an empty directory on commit. It will not be an error if the directory does not exist. It will not be an error if the directory is not empty.
path | path of directory to be deleted |
void commit_rmdir_tree_bg | ( | const nstring & | path | ) |
The commit_rmdir_tree_bg function is used to delete a directory tree on commit. It will not be an error if the directory does not exist. It will not be an error if the directory, or any subtree, is not empty.
path | path of directory to be deleted |
void commit_rmdir_tree_bg | ( | string_ty * | path | ) |
The commit_rmdir_tree_bg function is used to delete a directory tree on commit. It will not be an error if the directory does not exist. It will not be an error if the directory, or any subtree, is not empty.
path | path of directory to be deleted |
void commit_rmdir_tree_errok | ( | const nstring & | path | ) |
The commit_rmdir_tree_errok function is used to delete a directory tree on commit. It will not be an error if the directory does not exist. It will not be an error if the directory, or any subtree, is not empty.
path | path of directory to be deleted |
void commit_rmdir_tree_errok | ( | string_ty * | path | ) |
The commit_rmdir_tree_errok function is used to delete a directory tree on commit. It will not be an error if the directory does not exist. It will not be an error if the directory, or any subtree, is not empty.
path | path of directory to be deleted |
The commit_symlink function is used to submit a commit request to symlink a file at commit (success) time.
from | path of file now | |
to | path of symlink to create at commit time. |
The commit_symlink function is used to submit a commit request to symlink a file at commit (success) time.
from | path of file now | |
to | path of symlink to create at commit time. |
void commit_unlink_errok | ( | const nstring & | path | ) |
The commit_unlink_errok function is used to unlink a file on commit. It will not be an error if the file does not exist.
path | path of file to be unlinked |
void commit_unlink_errok | ( | string_ty * | path | ) |
The commit_unlink_errok function is used to unlink a file on commit. It will not be an error if the file does not exist.
path | path of file to be unlinked |
void undo | ( | void | ) |
The undo function is used to pun all pending operation in the undo queue.
void undo_cancel | ( | void | ) |
The undo_cancel function is used to cancel any pending operation from the undo queue.
void undo_chmod | ( | const nstring & | path, | |
int | mode | |||
) |
The undo_chmod function is used to put a chmod operation in the undo queue.
path | The path to have its mode changed. | |
mode | The mod to change the path to. |
void undo_chmod | ( | string_ty * | path, | |
int | mode | |||
) |
The undo_chmod function is used to put a chmod operation in the undo queue.
path | The path to have its mode changed. | |
mode | The mod to change the path to. |
void undo_chmod_errok | ( | const nstring & | path, | |
int | mode | |||
) |
The undo_chmod_errok function is used to put a chmod operation in the undo queue. Errors are ignored.
path | The path to have its mode changed. | |
mode | The mod to change the path to. |
void undo_chmod_errok | ( | string_ty * | path, | |
int | mode | |||
) |
The undo_chmod function is used to put a chmod operation in the undo queue. Errors are ignored.
path | The path to have its mode changed. | |
mode | The mod to change the path to. |
void undo_message | ( | const nstring & | msg | ) |
The undo_message function is used to print a message in the event of failure.
msg | The message to be printed. |
void undo_message | ( | string_ty * | msg | ) |
The undo_message function is used to print a message in the event of failure.
msg | The message to be printed. |
The undo_rename funtion is used to submit an undo request (rollback) to rename a file.
from | path of file now | |
to | path of file after rollback. |
The undo_rename funtion is used to submit an undo request (rollback) to rename a file.
from | path of file now | |
to | path of file after rollback. |
The undo_rename_cancel function is used to cancel an undo request submitted with undo_rename().
from | path of file now | |
to | path of file_after rollback. |
The undo_rename_cancel function is used to cancel an undo request submitted with undo_rename().
from | path of file now | |
to | path of file_after rollback. |
void undo_rmdir_bg | ( | const nstring & | path | ) |
The undo_rmdir_bg function is used to put a rmdir (recursive directory remove) operation in the undo queue. The operation is performed in the background.
path | The path of the directory to be removed. |
void undo_rmdir_bg | ( | string_ty * | path | ) |
The undo_rmdir_bg function is used to put a rmdir (recursive directory remove) operation in the undo queue. The operation is performed in the background.
path | The path of the directory to be removed. |
void undo_rmdir_errok | ( | const nstring & | path | ) |
The undo_rmdir_errok function is used to put a rmdir (non-recursive) operation in the undo queue. Any error (e.g. directory not empty) will be ignored.
path | The path of the directory to be removed. |
void undo_rmdir_errok | ( | string_ty * | path | ) |
The undo_rmdir_errok function is used to put a rmdir (non-recursive) operation in the undo queue. Any error (e.g. directory not empty) will be ignored.
path | The path of the directory to be removed. |
void undo_unlink_errok | ( | const nstring & | path | ) |
The undo_unlink_errok function si sued to put an unlink operation in the undo queue.
path | The path opf the file to be removed. |
void undo_unlink_errok | ( | string_ty * | path | ) |
The undo_unlink_errok function si sued to put an unlink operation in the undo queue.
path | The path opf the file to be removed. |