Skip to content
Snippets Groups Projects
Commit 4e64c5fb authored by rswindell's avatar rswindell
Browse files

Moved delfiles from file.cpp to xpdev/dirwrap.c (for sbbsecho).

parent 6044504c
Branches
Tags
No related merge requests found
...@@ -267,30 +267,6 @@ extern "C" BOOL filematch(char *filename, char *filespec) ...@@ -267,30 +267,6 @@ extern "C" BOOL filematch(char *filename, char *filespec)
return(TRUE); return(TRUE);
} }
/****************************************************************************/
/* Deletes all files in dir 'path' that match file spec 'spec' */
/****************************************************************************/
extern "C" uint delfiles(char *inpath, char *spec)
{
char path[MAX_PATH+1];
uint i,files=0;
glob_t g;
strcpy(path,inpath);
backslash(path);
strcat(path,spec);
glob(path,0,NULL,&g);
for(i=0;i<g.gl_pathc;i++) {
if(isdir(g.gl_pathv[i]))
continue;
CHMOD(g.gl_pathv[i],S_IWRITE); // Incase it's been marked RDONLY
if(remove(g.gl_pathv[i])==0)
files++;
}
globfree(&g);
return(files);
}
/*****************************************************************************/ /*****************************************************************************/
/* Checks the filename 'fname' for invalid symbol or character sequences */ /* Checks the filename 'fname' for invalid symbol or character sequences */
/*****************************************************************************/ /*****************************************************************************/
......
...@@ -941,7 +941,6 @@ BOOL md(char *path); ...@@ -941,7 +941,6 @@ BOOL md(char *path);
/* file.cpp */ /* file.cpp */
BOOL filematch(char *filename, char *filespec); BOOL filematch(char *filename, char *filespec);
uint delfiles(char *path, char *spec);
#endif /* SBBS */ #endif /* SBBS */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment