+Path get_home_dir()
+{
+#ifndef WIN32
+ const char *home=getenv("HOME");
+ if(home)
+ return home;
+ return ".";
+#else
+ return ".";
+#endif
+}
+
+void chdir(const Path &path)
+{
+ if(::chdir(path.str().c_str())==-1)
+ throw SystemError("chdir failed", errno);
+}
+