From 59d4ee3df765552afec79dc4400bc5a6ed706cdd Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Mon, 5 Sep 2016 21:35:21 +0200 Subject: [PATCH] added Utilities::chdir --- src/uvw/util.hpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/uvw/util.hpp b/src/uvw/util.hpp index 391faada..d0449967 100644 --- a/src/uvw/util.hpp +++ b/src/uvw/util.hpp @@ -532,6 +532,15 @@ struct Utilities { static uint64_t hrtime() noexcept { return uv_hrtime(); } + + /** + * @brief Changes the current working directory. + * @param dir The working directory to be set. + * @return True in case of success, false otherwise. + */ + static bool chdir(const std::string &dir) noexcept { + return (0 == uv_chdir(dir.data())); + } }; @@ -541,7 +550,6 @@ struct Utilities { * * uv_getrusage * * uv_exepath * * uv_cwd - * * uv_chdir * * uv_os_homedir * * uv_os_tmpdir * * uv_os_get_passwd