From 7a881ef67aa85a1f7732754db2b9103ebf1f0eb7 Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Sat, 23 Jun 2012 05:09:11 +0000 Subject: [PATCH] Remove PBD::sys::is_directory and use Glib equivalent git-svn-id: svn://localhost/ardour2/branches/3.0@12887 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/pbd/filesystem.cc | 10 ++-------- libs/pbd/pbd/filesystem.h | 3 --- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/libs/pbd/filesystem.cc b/libs/pbd/filesystem.cc index 7c76e5f053..558fc01227 100644 --- a/libs/pbd/filesystem.cc +++ b/libs/pbd/filesystem.cc @@ -63,16 +63,10 @@ path::operator/=(const char* rhs) return *this; } -bool -is_directory (const path & p) -{ - return Glib::file_test (p.to_string(), Glib::FILE_TEST_IS_DIR); -} - bool create_directory(const path & p) { - if(is_directory(p)) return false; + if (Glib::file_test (p.to_string(), Glib::FILE_TEST_IS_DIR)) return false; int error = g_mkdir (p.to_string().c_str(), S_IRWXU|S_IRWXG|S_IRWXO); @@ -86,7 +80,7 @@ create_directory(const path & p) bool create_directories(const path & p) { - if(is_directory(p)) return false; + if (Glib::file_test (p.to_string(), Glib::FILE_TEST_IS_DIR)) return false; int error = g_mkdir_with_parents (p.to_string().c_str(), S_IRWXU|S_IRWXG|S_IRWXO); diff --git a/libs/pbd/pbd/filesystem.h b/libs/pbd/pbd/filesystem.h index 3a3c09e258..7985940452 100644 --- a/libs/pbd/pbd/filesystem.h +++ b/libs/pbd/pbd/filesystem.h @@ -103,9 +103,6 @@ public: inline path operator/ (const path& lhs, const path& rhs) { return path(lhs) /= rhs; } -/// @return true if path at p is a directory. -bool is_directory(const path & p); - /** * Attempt to create a directory at p as if by the glib function g_mkdir * with a second argument of S_IRWXU|S_IRWXG|S_IRWXO