#include // chdir #include // perror int main(int argc, char* argv[]) { if(chdir(argv[1]) < 0) { perror("chdir"); return 1; } }