mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
recursive file copy function
This commit is contained in:
parent
b4438942ca
commit
6fbd0a62e4
2 changed files with 20 additions and 0 deletions
|
|
@ -329,6 +329,21 @@ copy_files(const std::string & from_path, const std::string & to_dir)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
copy_recurse(const std::string & from_path, const std::string & to_dir)
|
||||
{
|
||||
vector<string> files;
|
||||
find_files_matching_filter (files, from_path, accept_all_files, 0, false, true, true);
|
||||
|
||||
const size_t prefix_len = from_path.size();
|
||||
for (vector<string>::iterator i = files.begin(); i != files.end(); ++i) {
|
||||
std::string from = *i;
|
||||
std::string to = Glib::build_filename (to_dir, (*i).substr(prefix_len));
|
||||
g_mkdir_with_parents (Glib::path_get_dirname (to).c_str(), 0755);
|
||||
copy_file (from, to);
|
||||
}
|
||||
}
|
||||
|
||||
std::string
|
||||
get_absolute_path (const std::string & p)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue