- if(p.size()==1 && is_windows_drive(*i))
- continue;
-#endif
- struct stat st;
- int err=stat(p, st);
- if(err==0)
- {
- if(!S_ISDIR(st.st_mode))
- throw Exception("A component exists and is not a directory");
- continue;
- }
- else if(errno!=ENOENT)
- throw SystemError("stat failed", errno);
- else
- mkdir(p, mode);
- }
-}
-
-void rmdir(const Path &path)
-{
- if(::rmdir(path.str().c_str())==-1)
- throw SystemError("rmdir failed", errno);
-}
-
-void rmdirs(const Path &path)
-{
- list<string> files=list_files(path);
- for(list<string>::iterator i=files.begin(); i!=files.end(); ++i)
+ if(path.is_absolute())
+ return path;
+ else
+ return getcwd()/path;
+#else
+ list<string> queue(path.begin(), path.end());
+ if(!path.is_absolute())