aboutsummaryrefslogtreecommitdiff
path: root/build2/filesystem.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'build2/filesystem.cxx')
-rw-r--r--build2/filesystem.cxx27
1 files changed, 27 insertions, 0 deletions
diff --git a/build2/filesystem.cxx b/build2/filesystem.cxx
index 58e3037..bfda1c4 100644
--- a/build2/filesystem.cxx
+++ b/build2/filesystem.cxx
@@ -85,6 +85,33 @@ namespace build2
return ms;
}
+ fs_status<rmfile_status>
+ rmsymlink (const path& p, bool d, uint16_t v)
+ {
+ auto print = [&p, v] ()
+ {
+ if (verb >= v)
+ text << "rm " << p.string ();
+ };
+
+ rmfile_status rs;
+
+ try
+ {
+ rs = try_rmsymlink (p, d);
+ }
+ catch (const system_error& e)
+ {
+ print ();
+ fail << "unable to remove symlink " << p.string () << ": " << e << endf;
+ }
+
+ if (rs == rmfile_status::success)
+ print ();
+
+ return rs;
+ }
+
fs_status<butl::rmdir_status>
rmdir_r (const dir_path& d, bool dir, uint16_t v)
{