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
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)
{
*/
bool create_directories(const path & p);
+/**
+ * Attempt to delete the file at path p as if by the glib function
+ * g_unlink.
+ *
+ * @return true if file existed prior to removing it, false if file
+ * at p did not exist.
+ *
+ * @throw filesystem_error if removing the file failed for any other
+ * reason other than the file did not exist.
+ */
+bool remove(const path & p);
+
string basename (const path& p);
} // namespace sys