MCPcopy Create free account
hub / github.com/duckdb/duckdb / ChangeDirectory

Method ChangeDirectory

tools/shell/shell.cpp:2346–2359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2344}
2345
2346SuccessState ShellState::ChangeDirectory(const string &path) {
2347 int rc;
2348#if defined(_WIN32) || defined(WIN32)
2349 auto z = ShellState::Win32Utf8ToUnicode(path);
2350 rc = !SetCurrentDirectoryW(z.c_str());
2351#else
2352 rc = chdir(path.c_str());
2353#endif
2354 if (rc) {
2355 PrintF(PrintOutput::STDERR, "Cannot change to directory \"%s\"\n", path);
2356 return SuccessState::FAILURE;
2357 }
2358 return SuccessState::SUCCESS;
2359}
2360
2361SuccessState ShellState::ShowDatabases() {
2362 OpenDB();

Callers 1

ChangeDirectoryFunction · 0.80

Calls 1

c_strMethod · 0.80

Tested by

no test coverage detected