refactor: add pathbuf and std::string-friendly helpers to tr_sys file and path funcs (#3118)

* refactor: add sv-friendly tr_sys_dir_create() variant

* refactor: add sv-friendly tr_sys_path_get_info() variant

* refactor: add sv-friendly tr_sys_path_exists() variant

* refactor: add sv-friendly tr_sys_path_remove() variant

* refactor: add sv-friendly tr_sys_path_rename() variant

* fixup! refactor: add sv-friendly tr_sys_path_rename() variant
This commit is contained in:
Charles Kerr
2022-05-21 20:17:00 -05:00
committed by GitHub
parent 690cf50e53
commit c0bb2d40f1
20 changed files with 125 additions and 53 deletions

View File

@@ -293,7 +293,7 @@ static auto onFileAdded(tr_watchdir_t dir, char const* name, void* vsession)
tr_logAddInfo(fmt::format(_("Removing torrent file '{path}'"), fmt::arg("path", name)));
if (!tr_sys_path_remove(filename.c_str(), &error))
if (!tr_sys_path_remove(filename, &error))
{
tr_logAddError(fmt::format(
_("Couldn't remove '{path}': {error} ({error_code})"),
@@ -906,7 +906,7 @@ CLEANUP:
/* cleanup */
if (pidfile_created)
{
tr_sys_path_remove(sz_pid_filename.c_str());
tr_sys_path_remove(sz_pid_filename);
}
sd_notify(0, "STATUS=\n");