Look at either the header file io.h or dir.h. I'm not sure which it is for Borland as I am on DevC++ but in either of the two there should be a struct called wither _finddata_t or ffblk which has variables in it that correspond to attributes such as readonly subdir and so forth as well as time created, size, time last accessed, and name. I don't know the specifics yet as I am still learning how to use this header file to do pretty much what you are saying but I believe you would do something along the line of this:
Code:
#include<dir.h>
struct _finddata_t find
/*-----code-----*/
int done,x=1;
char *fin="Search Complete";
done = _findfirst(filename, &find);
while (done != (-1))
{
printf(" File %s occured %d time(s)\n",filename,x++);
if (done == _A_SUDDIR)
{ /*sub directory constant may be different for your compiler*/
chdir(find.name)
done = _findnext( done, &find);
printf(" File %s occured %d time(s)\n",filename,x++);
}
done = _findnext( done, &find);
}
_findclose(done);
puts(fin);
exit(0);
}
That is not the best so will someone else please critique it.