13
0

Remove PBD::sys::is_directory and use Glib equivalent

git-svn-id: svn://localhost/ardour2/branches/3.0@12887 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Tim Mayberry 2012-06-23 05:09:11 +00:00
parent 6b62959ba0
commit 7a881ef67a
2 changed files with 2 additions and 11 deletions

View File

@ -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);

View File

@ -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