Code:
#include <stdio.h>
#include <dir.h>
#include <string.h>
#define ALL_ATTS (FA_DIREC | FA_ARCH) /* explain */
basicly he is saying ALL_ATTS is the same as FA_DIREC and FA_ARCH. Like when one does a open() wiht multipule flags
Code:
void walker(const char *path, const char *findme)
{
struct ffblk finder;/* explain */
Im not gonna tell you but look at how a structur is definded
struct name
{
variables
} tag;
Code:
chdir(path);
/* explain */
man chdir.. the name really is really explaniatory
Code:
for (res = findfirst("*.*", &finder, ALL_ATTS); res == 0; res = findnext(&finder)) /* explain */
Look at for loops, its really strate forward.
Code:
{
if (strcmp(finder.ff_name, ".") == 0) continue; /* explain */
if (strcmp(finder.ff_name, "..") == 0) continue; /* explain */
What are you look for here? they are plain if statements
Code:
if (finder.ff_attrib & FA_DIREC) /* explain */
{
char newpath[MAXPATH];
strcpy(newpath, path);
strcat(newpath, "\\");
strcat(newpath, finder.ff_name);
chdir(finder.ff_name); /* explain */
walker(newpath, findme);
chdir(".."); /* explain */
the if(finder.ff_attrib & FA_DIREC) is testing to see if the flag FA_DIREC is set.
the chdir()'s are explaind in the man pages.