This repository has been archived on 2026-03-18. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
netbenixCMD/commands/change_dir.c
2020-06-07 11:16:25 +02:00

20 lines
No EOL
330 B
C

#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <dirent.h>
#include "change_dir.h"
#include "../utils/logger.h"
void changeCurrentWorkDir(char *arg[]){
DIR *d;
struct dirent *dir;
d = opendir(arg[1]);
if(d == NULL){
printf("Folder not found.\n");
return;
} else {
chdir(arg[1]);
}
closedir(d);
}