Created
March 26, 2017 11:41
-
-
Save yurriy/526a3f6bcc303fe48bb85d45532bcb7e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct dirent *file; | |
unsigned long long ans = 0; | |
while ((file = readdir(d))) { | |
if (!strcmp(file->d_name, ".") || !strcmp(file->d_name, "..")) { | |
continue; | |
} | |
struct stat buf; | |
full_name[dir_name_len] = '/'; | |
strcpy(full_name + dir_name_len + 1, file->d_name); | |
if (!stat(full_name, &buf) && check(file->d_name, &buf)) { | |
ans += buf.st_size; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment