home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 3 Comm
/
03-Comm.zip
/
RDQWKSRC.ZIP
/
SYSTEM.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-01-15
|
1KB
|
56 lines
/*
DOS System-Dependant functions for Read.c
*/
#include <dos.h>
/*
Deletes ALL files in a directory pointed by PathName.
This is system-dependant.
*/
void Erase(PathName )
char *PathName;
{
char tmp[127];
char Pattern[127];
int ok;
struct DocFile /* MSC et Turbo under DOS use */
{ /* different names. Here are my */
char Reserved[21]; /* own for both two, and a nice */
char attr; /* warning... :-) */
unsigned Time;
unsigned Date;
long Len;
char Name[13];
} FileDoc;
sprintf(Pattern,"%s\\*.*",PathName );
#ifdef __TURBOC__
ok= findfirst(Pattern,&FileDoc,0);
#else
ok= _dos_findfirst(Pattern,0,&FileDoc);
#endif
if(ok!=0) return;
while(!ok)
{
sprintf(tmp,"%s\\%s",PathName,FileDoc.Name);
unlink(tmp);
#ifdef __TURBOC__
ok= findnext(&FileDoc);
#else
ok= _dos_findnext(&FileDoc);
#endif
}
}
/*-------------------------------------------------------------------------*/