return result;
}
+/**
+Creates the given directory and any parent directories if needed.
+
+@param path The path to create
+@param mode Access mode for new directories
+
+@return 0 on success, -1 on error
+*/
int mkpath(const Path &path, int mode)
{
Path p;
return result;
}
+/**
+Extracts the basename from the given path. Same thing as Path::Path(p)[-1],
+but faster.
+*/
+string basename(const std::string &p);
+{
+ unsigned slash=p.rfind(DIRCHAR);
+ if(slash==string::npos)
+ return p;
+ else
+ return p.substr(slash+1);
+}
+
} // namespace Path
} // namespace Msp
extern Filename splitext(const std::string &);
extern int fnmatch(const std::string &, const Path &);
extern Path relative(const Path &, const Path &);
+extern std::string basename(const std::string &);
inline int stat(const Path &fn, struct stat &st)
{ return ::stat(fn.str().c_str(), &st); }