throw system_error("rmdir");
}
+Path getcwd()
+{
+ char buf[1024];
+ return ::getcwd(buf, sizeof(buf));
+}
+
+void chdir(const Path &path)
+{
+ if(::chdir(path.str().c_str())==-1)
+ throw system_error("chdir");
+}
+
Path get_home_dir()
{
const char *home = getenv("HOME");
Path get_user_data_dir(const string &appname)
{
+ if(appname.empty())
+ throw invalid_argument("get_user_data_dir");
return get_home_dir()/("."+appname);
}