init commit

This commit is contained in:
2025-04-13 21:48:15 +03:00
commit 23255e9121
192 changed files with 12200 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/file.h>
#include <sys/types.h>
#include <string.h>
enum
{
KIBIBYTE = 1024
};
int
main(int argc, char *argv[])
{
long long int sum = 0;
for (int i = 1; i < argc; ++i) {
struct stat st;
if (!(lstat(argv[i], &st) < 0 || st.st_nlink != 1 || !S_ISREG(st.st_mode) || st.st_size % KIBIBYTE != 0)) {
sum += st.st_size;
}
}
printf("%lld\n", sum);
return 0;
}