aboutsummaryrefslogtreecommitdiff
path: root/src/path.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/path.cc')
-rw-r--r--src/path.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/path.cc b/src/path.cc
index 103e2c5..30e81cc 100644
--- a/src/path.cc
+++ b/src/path.cc
@@ -1,5 +1,12 @@
#include "path.h"
+#include <pwd.h>
+#include <unistd.h>
+
+#include "global.h"
+#include "util/string.h"
+#include "util/io.h"
+
namespace ov4
{
@@ -67,5 +74,10 @@ string get_current_dir()
return safe_str(getcwd(buf, MAXLINE));
}
+string get_home_dir()
+{
+ return getpwuid(getuid())->pw_dir;
+}
+
}