Add function PBD::sys::remove as a wrapper to g_unlink

API is intended to be indentical(apart from the string type) to boost::filesystem::remove


git-svn-id: svn://localhost/ardour2/trunk@2372 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Tim Mayberry 2007-09-04 04:48:04 +00:00
parent f9c202dba0
commit 29842063e3
2 changed files with 26 additions and 0 deletions

View file

@ -94,6 +94,20 @@ create_directories(const path & p)
return true;
}
bool
remove(const path & p)
{
if(!exists(p)) return false;
int error = g_unlink (p.to_string().c_str());
if(error == -1)
{
throw filesystem_error(g_strerror(errno), errno);
}
return true;
}
string
basename (const path & p)
{