home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 2 BBS
/
02-BBS.zip
/
VP2SRC.ZIP
/
FILEDIR.C
< prev
next >
Wrap
Text File
|
1991-04-20
|
1KB
|
67 lines
#include <dos.h>
#include <string.h>
#include "fastecho.h"
#ifndef OS2
#define dir_findfirst _dos_findfirst
#define dir_findnext _dos_findnext
#endif
static struct find_t sbuf;
static struct find_t sbuf1;
int filedir (
char *name,
int times,
char *ret_str,
int mode)
{
if (times == 0)
{
if (dir_findfirst (name, mode, &sbuf))
{
sbuf.name[0] = '\0';
sbuf.attrib = 0;
}
strcpy (ret_str, sbuf.name);
}
else
{
if (dir_findnext (&sbuf))
{
sbuf.name[0] = '\0';
sbuf.attrib = 0;
}
strcpy (ret_str, sbuf.name);
}
return (sbuf.attrib);
}
long filedir1 (
char *name,
int times,
char *ret_str)
{
if (times == 0)
{
if (dir_findfirst (name, 0, &sbuf1))
{
sbuf1.name[0] = '\0';
sbuf1.size = 0;
}
strcpy (ret_str, sbuf1.name);
}
else
{
if (dir_findnext (&sbuf1))
{
sbuf1.name[0] = '\0';
sbuf1.size = 0;
}
strcpy (ret_str, sbuf1.name);
}
return (sbuf1.size);
}