#include #include #include #include #include #include int dirsiz (char *); void help (); main (int a, char** v) { if (!--a) help (); ++v; int b; struct stat tmp; for (b=0;bd_name, ".") || !strcmp (tmp->d_name, "..")) continue; strcpy (tstr, fn); strcat (tstr, "/"); strcat (tstr, tmp->d_name); stat (tstr, &tp); if (S_ISDIR (tp.st_mode)) ret += dirsiz (tstr); else ret += tp.st_size; } return ret; }