Re: A Q for C gurus

Anthony Young (tony@nospam.ftoomsh.socs.uts.edu.au)
Thu, 26 Jan 1995 12:36:31 +1100 (EST)

For any who are interested, this is the solution I came up
with from the help I received....

#include <sys/stat.h>
#include <string.h>
#include <dir.h>
#include <dos.h>

void main()
{
struct ffblk *f;
struct stat *s;
char dummy[1024];

findfirst("*.*",f,63);
strcpy(dummy,(f->ff_name));
stat((f->ff_name),s);
if (((s->st_mode) & S_IFDIR) == S_IFDIR)
printf("%s\n",dummy);
while ((findnext(f)) == 0) {
strcpy(dummy,(f->ff_name));
stat((f->ff_name),s);
if (((s->st_mode) & S_IFDIR) == S_IFDIR)
printf("%s\n",dummy);
}
}

For some reason the stat function stuffed up (f->ff_name), so I had
to copy ff_name to a dummy variable to be able to display it.
It may not look nice, but then... it is only a test function :)

Thanx for all the help guys..
Tony Young...8)
email: tony@nospam.ftoomsh.socs.uts.edu.au
University of Technology, Sydney
----------------------------------------------------------------------
Obstacles are things you see when you take your mind off your goals!