llvm.org GIT mirror llvm / bb0a612
sys::Process: Add a SetWorkingDirectory method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140433 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Dunbar 8 years ago
3 changed file(s) with 13 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
137137
138138 /// Resets the terminals colors, or returns an escape sequence to do so.
139139 static const char *ResetColor();
140
141 /// Change the program working directory to that given by \arg Path.
142 static void SetWorkingDirectory(std::string Path);
140143 /// @}
141144 };
142145 }
292292 const char *Process::ResetColor() {
293293 return "\033[0m";
294294 }
295
296 void Process::SetWorkingDirectory(std::string Path) {
297 ::chdir(Path.c_str());
298 }
1414 #include
1515 #include
1616 #include
17 #include
1718
1819 #ifdef __MINGW32__
1920 #if (HAVE_LIBPSAPI != 1)
218219 return 0;
219220 }
220221
221 }
222 void Process::SetWorkingDirectory(std::string Path) {
223 ::_chdir(Path.c_str());
224 }
225
226 }