aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/filesystem.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-11-02 16:56:35 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-11-02 20:38:57 +0300
commita1d00de1408b36b6b68d18d1c1e1fba7df1add49 (patch)
treec6add78f6380f9325648be5698da10c311ed2e9b /libbuild2/filesystem.cxx
parent809123f03100ee9ed90d31424304c22ba28e842c (diff)
Set executable bit for ad hoc buildscript rule executable target on POSIX
Diffstat (limited to 'libbuild2/filesystem.cxx')
-rw-r--r--libbuild2/filesystem.cxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/libbuild2/filesystem.cxx b/libbuild2/filesystem.cxx
index 0072408..fbe145c 100644
--- a/libbuild2/filesystem.cxx
+++ b/libbuild2/filesystem.cxx
@@ -297,4 +297,30 @@ namespace build2
//
return rmdir (ctx, d, verbosity);
}
+
+ permissions
+ path_perms (const path& p)
+ {
+ try
+ {
+ return path_permissions (p);
+ }
+ catch (const system_error& e)
+ {
+ fail << "unable to obtain path " << p << " permissions: " << e << endf;
+ }
+ }
+
+ void
+ path_perms (const path& p, permissions f)
+ {
+ try
+ {
+ path_permissions (p, f);
+ }
+ catch (const system_error& e)
+ {
+ fail << "unable to set path " << p << " permissions: " << e;
+ }
+ }
}