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:
parent
6b62959ba0
commit
7a881ef67a
@ -63,16 +63,10 @@ path::operator/=(const char* rhs)
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
is_directory (const path & p)
|
|
||||||
{
|
|
||||||
return Glib::file_test (p.to_string(), Glib::FILE_TEST_IS_DIR);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
create_directory(const path & p)
|
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);
|
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
|
bool
|
||||||
create_directories(const path & p)
|
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);
|
int error = g_mkdir_with_parents (p.to_string().c_str(), S_IRWXU|S_IRWXG|S_IRWXO);
|
||||||
|
|
||||||
|
@ -103,9 +103,6 @@ public:
|
|||||||
inline path operator/ (const path& lhs, const path& rhs)
|
inline path operator/ (const path& lhs, const path& rhs)
|
||||||
{ return path(lhs) /= 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
|
* 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
|
* with a second argument of S_IRWXU|S_IRWXG|S_IRWXO
|
||||||
|
Loading…
Reference in New Issue
Block a user