aboutsummaryrefslogtreecommitdiff
path: root/bpkg/utility.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'bpkg/utility.cxx')
-rw-r--r--bpkg/utility.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/bpkg/utility.cxx b/bpkg/utility.cxx
index 632791c..d9e0413 100644
--- a/bpkg/utility.cxx
+++ b/bpkg/utility.cxx
@@ -93,6 +93,23 @@ namespace bpkg
}
void
+ rm (const path& f)
+ {
+ if (verb >= 3)
+ text << "rm " << f;
+
+ try
+ {
+ if (try_rmfile (f) == rmfile_status::not_exist)
+ fail << "unable to remove file " << f << ": file does not exist";
+ }
+ catch (const system_error& e)
+ {
+ fail << "unable to remove file " << f << ": " << e.what ();
+ }
+ }
+
+ void
rm_r (const dir_path& d, bool dir)
{
if (verb >= 3)