mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 19:16:40 +01:00
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:
parent
f9c202dba0
commit
29842063e3
2 changed files with 26 additions and 0 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue