utils/file: add basename/dirname helpers and use them

This commit is contained in:
Dirk-Jan C. Binnema
2023-09-10 10:10:57 +03:00
parent b89e9354ec
commit c8568eecd4
5 changed files with 43 additions and 16 deletions

View File

@ -155,7 +155,7 @@ get_target_fullpath(const std::string& src, const std::string& targetpath,
if (auto&& res = check_subdir(src, in_cur); !res)
return Err(std::move(res.error()));
const auto srcfile{to_string_gchar(g_path_get_basename(src.c_str()))};
const auto srcfile{basename(src)};
/* create target-path; note: make the filename *cough* unique by
* including a hash of the srcname in the targetname. This helps if