/* $Id$
-This file is part of libmsppath
-Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions
+This file is part of libmspfs
+Copyright © 2006-2008 Mikko Rasa, Mikkosoft Productions
Distributed under the LGPL
*/
#include <dirent.h>
-#include <errno.h>
+#include <cerrno>
+#include <cstdlib>
#include <msp/core/except.h>
#ifndef WIN32
#include <fnmatch.h>
{
Path::Iterator i=path.begin();
Path::Iterator j=base.begin();
- for(; (i!=path.end() && j!=base.end() && *i==*j); ++i,++j);
+ for(; (i!=path.end() && j!=base.end() && *i==*j); ++i, ++j) ;
Path result;
for(; j!=base.end(); ++j)
#endif
}
+void chdir(const Path &path)
+{
+ if(::chdir(path.str().c_str())==-1)
+ throw SystemError("chdir failed", errno);
+}
+
} // namespace Msp