summaryrefslogtreecommitdiff
path: root/libs/pbd/filesystem.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/pbd/filesystem.cc')
-rw-r--r--libs/pbd/filesystem.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/libs/pbd/filesystem.cc b/libs/pbd/filesystem.cc
index 229b22fcb5..aefe6d525c 100644
--- a/libs/pbd/filesystem.cc
+++ b/libs/pbd/filesystem.cc
@@ -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)
{