#include<stdio.h>
#include<stdlib.h>
#include<sys/stat.h>
#include<unistd.h>
#include<errno.h>
#include<dirent.h>
#include<sys/types.h>
#define SIZE 1024
int dir_run(char *path)
{ DIR *dir;
dir = opendir(path);
if (dir == NULL)
{
return -1;
}
struct stat st;
struct dirent *entry;
char fullpath[SIZE];
while((entry = readdir(dir)) != NULL)
{
if((strcmp(entry->d_name, ".") == 0) || (strcmp(entry->d_name, "..") == 0))
{
continue;
}
sprintf(fullpath, "%s/%s", path, entry->d_name);
if(lstat(fullpath, &st) != 0)
{
#include<stdlib.h>
#include<sys/stat.h>
#include<unistd.h>
#include<errno.h>
#include<dirent.h>
#include<sys/types.h>
#define SIZE 1024
int dir_run(char *path)
{ DIR *dir;
dir = opendir(path);
if (dir == NULL)
{
return -1;
}
struct stat st;
struct dirent *entry;
char fullpath[SIZE];
while((entry = readdir(dir)) != NULL)
{
if((strcmp(entry->d_name, ".") == 0) || (strcmp(entry->d_name, "..") == 0))
{
continue;
}
sprintf(fullpath, "%s/%s", path, entry->d_name);
if(lstat(fullpath, &st) != 0)
{