--- /dev/null
+#include <cstdlib>
+#include "dir.h"
+
+using namespace std;
+
+namespace Msp {
+namespace FS {
+
+Path get_home_dir()
+{
+ const char *home = getenv("HOME");
+ if(home)
+ return home;
+ return ".";
+}
+
+Path get_user_data_dir(const string &appname)
+{
+ if(appname.empty())
+ throw invalid_argument("get_user_data_dir");
+ return get_home_dir()/("."+appname);
+}
+
+} // namespace FS
+} // namespace Msp