aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-06-28 19:43:18 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-06-28 19:43:18 +0000
commit4aa5fcbe170fcb488e1c6d321906534f038f5520 (patch)
treed57bb1c69ba00024035349caaffc709f3f76c83a
parent6ee57e3c770187882b1bf6536ba72b333d009474 (diff)
downloadpaludis-4aa5fcbe170fcb488e1c6d321906534f038f5520.tar.gz
paludis-4aa5fcbe170fcb488e1c6d321906534f038f5520.tar.xz
Add chmod member function to FSEntry
-rw-r--r--paludis/util/fs_entry.cc7
-rw-r--r--paludis/util/fs_entry.hh7
2 files changed, 14 insertions, 0 deletions
diff --git a/paludis/util/fs_entry.cc b/paludis/util/fs_entry.cc
index 913ba90..7a95457 100644
--- a/paludis/util/fs_entry.cc
+++ b/paludis/util/fs_entry.cc
@@ -408,6 +408,13 @@ FSEntry::chown(const uid_t owner, const gid_t group)
throw FSError("chown '" + _path + "' failed: " + ::strerror(errno));
}
+void
+FSEntry::chmod(const mode_t mode)
+{
+ if (0 != ::chmod(_path.c_str(), mode))
+ throw FSError("chmod '" + _path + "' failed: " + ::strerror(errno));
+}
+
uid_t
FSEntry::owner() const
{
diff --git a/paludis/util/fs_entry.hh b/paludis/util/fs_entry.hh
index 45e9a1c..bf666ee 100644
--- a/paludis/util/fs_entry.hh
+++ b/paludis/util/fs_entry.hh
@@ -273,6 +273,13 @@ namespace paludis
void chown(const uid_t owner, const gid_t group);
/**
+ * Change our permissions.
+ *
+ * \exception FSError If the chmod failed.
+ */
+ void chmod(const mode_t mode);
+
+ /**
* Fetch our owner.
*
* \exception FSError If we don't exist or the stat call fails.