diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2023-05-16 11:00:44 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2023-05-16 11:00:44 +0200 |
commit | 5de2cb9ae1ed011469a208ae07df913f7bee88eb (patch) | |
tree | 9f589ef3448afe4d697f4e18fd10820aa2082d94 /libbutl/filesystem.cxx | |
parent | 42e678071fdbda4890b24c9138c426c573e3ea56 (diff) |
Allow passing custom permissions to cpfile()
Diffstat (limited to 'libbutl/filesystem.cxx')
-rw-r--r-- | libbutl/filesystem.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libbutl/filesystem.cxx b/libbutl/filesystem.cxx index bb3e8b0..07d0590 100644 --- a/libbutl/filesystem.cxx +++ b/libbutl/filesystem.cxx @@ -1695,9 +1695,12 @@ namespace butl } void - cpfile (const path& from, const path& to, cpflags fl) + cpfile (const path& from, + const path& to, + cpflags fl, + optional<permissions> cperm) { - permissions perm (path_permissions (from)); + permissions perm (cperm ? *cperm : path_permissions (from)); auto_rmfile rm; cpfile<is_base_of<system_error, ios_base::failure>::value> ( |