17 int file_dir_existed(
char *path_name)
21 if ((stat (path_name, &sts)) == -1)
36 char RMcmd[MAX_LENGTH];
38 memset(RMcmd,
'\0',
sizeof(RMcmd));
39 snprintf(RMcmd, MAX_LENGTH-1,
"rm -rf '%s'", dirpath);
47 int result = file_dir_existed(
"./test-data");
48 printf(
"result is:%d\n", result);
int RemoveDir(char *dirpath)
Remove all files under dirpath.