summaryrefslogtreecommitdiff
path: root/src/generic/util/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/generic/util/util.h')
-rw-r--r--src/generic/util/util.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/generic/util/util.h b/src/generic/util/util.h
index 6a34263c..1aacde6f 100644
--- a/src/generic/util/util.h
+++ b/src/generic/util/util.h
@@ -115,6 +115,18 @@ namespace aptitude
*/
bool recursive_remdir(const std::string &dirname);
+ /** Remove the given file/directory (non recursive if it is the latter).
+ * Behaves like rm -f.
+ *
+ * Errors are logged to _error.
+ *
+ * @param path The file/directory to remove.
+ * @param ignore_if_not_exists Ignore errors if the path does not exist
+ *
+ * @return \b true if successful, \b false otherwise.
+ */
+ bool remove_non_recursive(const std::string& path, bool ignore_if_not_exists = false);
+
/** Make a directory and all of its parents.
*
* \param dirname the directory to make.