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