#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <dirent.h>
#include <libgen.h>
#include <string.h>
void rmr(char* path)
{
DIR* dir = opendir(path);
if(dir == NULL)
perror("opendir"),exit(-1);
struct dirent* ent;
char buf[256];
while((ent=readdir(dir)))
{
if(ent->d_type == 4)
{
if(strcmp(ent->d_name,".")==0||strcmp(ent->d_name,"..")==0)
continue;
sprintf(buf,"%s/%s",path,ent->d_name);
rmr(buf);
}
if(ent->d_type == 8)
{
sprintf(buf,"%s/%s",path,en
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <dirent.h>
#include <libgen.h>
#include <string.h>
void rmr(char* path)
{
DIR* dir = opendir(path);
if(dir == NULL)
perror("opendir"),exit(-1);
struct dirent* ent;
char buf[256];
while((ent=readdir(dir)))
{
if(ent->d_type == 4)
{
if(strcmp(ent->d_name,".")==0||strcmp(ent->d_name,"..")==0)
continue;
sprintf(buf,"%s/%s",path,ent->d_name);
rmr(buf);
}
if(ent->d_type == 8)
{
sprintf(buf,"%s/%s",path,en