mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 15:54:57 +01:00
update semantics of PBD::remove_directory()
Remove the directory recursively including itself. The function is used in two places only: * LV2Plugin::add_state() -- no change, remove tmp. state * Session::save_as() -- on error, remove target In both cases removing the folder itself is correct.
This commit is contained in:
parent
cf761d4f67
commit
e344d379d2
3 changed files with 4 additions and 10 deletions
|
|
@ -476,6 +476,7 @@ void
|
||||||
remove_directory (const std::string& dir)
|
remove_directory (const std::string& dir)
|
||||||
{
|
{
|
||||||
remove_directory_internal (dir, 0, 0, false);
|
remove_directory_internal (dir, 0, 0, false);
|
||||||
|
g_rmdir (dir.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
string
|
string
|
||||||
|
|
|
||||||
|
|
@ -235,9 +235,9 @@ LIBPBD_API int clear_directory (const std::string& dir, size_t* size = 0,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove all the contents of a directory recursively.
|
* Remove all the contents of a directory recursively.
|
||||||
* @note dir will not be removed
|
* including the dir itself (`rm -rf $dir`)
|
||||||
*
|
*
|
||||||
* @param dir The directory to remove files from.
|
* @param dir The directory to remove recursively
|
||||||
*/
|
*/
|
||||||
LIBPBD_API void remove_directory (const std::string& dir);
|
LIBPBD_API void remove_directory (const std::string& dir);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -335,14 +335,7 @@ FilesystemTest::testRemoveDirectory ()
|
||||||
|
|
||||||
PBD::remove_directory (output_dir_path);
|
PBD::remove_directory (output_dir_path);
|
||||||
|
|
||||||
// doesn't actually remove directory though...just contents
|
CPPUNIT_ASSERT (!Glib::file_test (output_dir_path, Glib::FILE_TEST_EXISTS));
|
||||||
CPPUNIT_ASSERT (Glib::file_test (output_dir_path, Glib::FILE_TEST_IS_DIR));
|
|
||||||
|
|
||||||
files_in_output_dir.clear ();
|
|
||||||
|
|
||||||
PBD::get_paths (files_in_output_dir, output_dir_path, false, true);
|
|
||||||
|
|
||||||
CPPUNIT_ASSERT (files_in_output_dir.size () == 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue