X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/40f8a8ba8c2e7ff9ce80781250c863c07ac130dd..83b880c6505a20247239d897b7387bba37942993:/apt-pkg/contrib/fileutl.cc diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index 26945c183..1eabf37f4 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -2018,3 +2018,14 @@ std::string GetTempDir() return string(tmpdir); } + +bool Rename(std::string From, std::string To) +{ + if (rename(From.c_str(),To.c_str()) != 0) + { + _error->Error(_("rename failed, %s (%s -> %s)."),strerror(errno), + From.c_str(),To.c_str()); + return false; + } + return true; +}