MCPcopy Create free account
hub / github.com/davisking/dlib / set_current_dir

Function set_current_dir

dlib/misc_api/misc_api_kernel_1.cpp:79–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77// ----------------------------------------------------------------------------------------
78
79 void set_current_dir (
80 const std::string& new_dir
81 )
82 {
83 // need to lock a mutex here because getting and setting the
84 // current working directory is not thread safe on windows.
85 auto_mutex lock(cwd_mutex());
86 if (SetCurrentDirectoryA(new_dir.c_str()) == 0)
87 {
88 throw set_current_dir_error("Error changing current dir to '" + new_dir + "'");
89 }
90 }
91
92// ----------------------------------------------------------------------------------------
93

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected