]> git.tdb.fi Git - libs/core.git/blobdiff - source/fs/unix/dir.cpp
Split getcwd and chdir to platform files
[libs/core.git] / source / fs / unix / dir.cpp
index 69e926adf189e7087f3772b546248ad80079bd2a..8169a63fffbe9809af24012ed4ae28101ac881e3 100644 (file)
@@ -21,6 +21,18 @@ void rmdir(const Path &path)
                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");