Commit bcbce040 authored by rswindell's avatar rswindell
Browse files

Reverted back to "*.*" for Win32 targets, using macro (ALLFILES) to match all files ("*") on Unix.

Pkzip/unzip required *.* to add/extract all files in a directory. <sigh>
parent 5bf46e48
......@@ -312,7 +312,7 @@ void sbbs_t::batchmenu()
action=NODE_ULNG;
SYNC;
if(online==ON_REMOTE) {
delfiles(cfg.temp_dir,"*");
delfiles(cfg.temp_dir,ALLFILES);
start=time(NULL);
protocol(cmdstr(cfg.prot[xfrprot]->batulcmd,str,nulstr,NULL),1);
end=time(NULL);
......@@ -320,13 +320,13 @@ void sbbs_t::batchmenu()
starttime+=end-start;
}
batch_upload();
delfiles(cfg.temp_dir,"*");
delfiles(cfg.temp_dir,ALLFILES);
autohangup();
}
break;
}
}
delfiles(cfg.temp_dir,"*");
delfiles(cfg.temp_dir,ALLFILES);
}
/****************************************************************************/
......
......@@ -1211,7 +1211,7 @@ int sbbs_t::listfileinfo(uint dirnum, char *filespec, long mode)
CRLF; }
} }
else {
delfiles(cfg.temp_dir,"*");
delfiles(cfg.temp_dir,ALLFILES);
if(cfg.dir[f.dir]->seqdev) {
lncntr=0;
seqwait(cfg.dir[f.dir]->seqdev);
......@@ -1254,7 +1254,7 @@ int sbbs_t::listfileinfo(uint dirnum, char *filespec, long mode)
else {
bprintf(text[FileNotSent],f.name);
notdownloaded(f.size,start,end); } }
delfiles(cfg.temp_dir,"*");
delfiles(cfg.temp_dir,ALLFILES);
autohangup(); } } }
closefile(&f); }
if(filespec[0] && !strchr(filespec,'*') && !strchr(filespec,'?'))
......
......@@ -195,7 +195,7 @@ bool sbbs_t::logon()
starttime=logontime;
last_ns_time=ns_time=useron.ns_time;
// ns_time-=(useron.tlast*60); /* file newscan time == last logon time */
delfiles(cfg.temp_dir,"*");
delfiles(cfg.temp_dir,ALLFILES);
sprintf(str,"%smsgs/n%3.3u.msg",cfg.data_dir,cfg.node_num);
remove(str); /* remove any pending node messages */
sprintf(str,"%smsgs/n%3.3u.ixb",cfg.data_dir,cfg.node_num);
......
......@@ -134,7 +134,7 @@ void sbbs_t::logout()
if(!flength(str)) /* remove any 0 byte message files */
remove(str);
delfiles(cfg.temp_dir,"*");
delfiles(cfg.temp_dir,ALLFILES);
putmsgptrs();
if(!REALSYSOP)
logofflist();
......
......@@ -428,7 +428,7 @@ void sbbs_t::newuser()
return; } } }
sprintf(str,"%sfile/%04u.IN",cfg.data_dir,useron.number); /* delete any files */
delfiles(str,"*"); /* waiting for user */
delfiles(str,ALLFILES); /* waiting for user */
rmdir(str);
sprintf(tmp,"%04u.*",useron.number);
sprintf(str,"%sfile",cfg.data_dir);
......
......@@ -69,7 +69,7 @@ bool sbbs_t::pack_qwk(char *packet, ulong *msgcnt, bool prepack)
if(prepack)
ex|=EX_OFFLINE;
delfiles(cfg.temp_dir,"*");
delfiles(cfg.temp_dir,ALLFILES);
sprintf(str,"%sfile/%04u.qwk",cfg.data_dir,useron.number);
if(fexist(str)) {
for(k=0;k<cfg.total_fextrs;k++)
......@@ -78,7 +78,7 @@ bool sbbs_t::pack_qwk(char *packet, ulong *msgcnt, bool prepack)
break;
if(k>=cfg.total_fextrs)
k=0;
i=external(cmdstr(cfg.fextr[k]->cmd,str,"*",NULL),ex);
i=external(cmdstr(cfg.fextr[k]->cmd,str,ALLFILES,NULL),ex);
if(!i)
preqwk=1; }
......
......@@ -59,11 +59,11 @@ bool sbbs_t::pack_rep(uint hubnum)
smbmsg_t msg;
msgcnt=0L;
delfiles(cfg.temp_dir,"*");
delfiles(cfg.temp_dir,ALLFILES);
sprintf(str,"%s%s.rep",cfg.data_dir,cfg.qhub[hubnum]->id);
if(fexist(str)) {
lprintf("Updating %s", str);
external(cmdstr(cfg.qhub[hubnum]->unpack,str,"*",NULL),EX_OFFLINE);
external(cmdstr(cfg.qhub[hubnum]->unpack,str,ALLFILES,NULL),EX_OFFLINE);
} else
lprintf("Creating %s", str);
/*************************************************/
......@@ -229,7 +229,7 @@ bool sbbs_t::pack_rep(uint hubnum)
return(false); }
sprintf(str,"%sqnet/%s.out/",cfg.data_dir,cfg.qhub[hubnum]->id);
strlwr(str);
delfiles(str,"*");
delfiles(str,ALLFILES);
if(packedmail) { /* Delete NetMail */
sprintf(smb.file,"%smail",cfg.data_dir);
......
......@@ -325,7 +325,7 @@ void sbbs_t::qwk_success(ulong msgcnt, char bi, char prepack)
if(useron.rest&FLAG('Q')) { // Was if(!prepack) only
sprintf(str,"%sqnet/%.8s.out/",cfg.data_dir,useron.alias);
strlwr(str);
delfiles(str,"*");
delfiles(str,ALLFILES);
}
if(!prepack) {
......@@ -337,7 +337,7 @@ void sbbs_t::qwk_success(ulong msgcnt, char bi, char prepack)
if(!bi) {
batch_download(-1);
delfiles(cfg.temp_dir,"*"); } }
delfiles(cfg.temp_dir,ALLFILES); } }
if(useron.rest&FLAG('Q'))
useron.qwk|=(QWK_EMAIL|QWK_ALLMAIL|QWK_DELMAIL);
......@@ -423,7 +423,7 @@ void sbbs_t::qwk_sec()
bi++; /* number of bidirectional protocols configured */
if(useron.rest&FLAG('Q'))
getusrsubs();
delfiles(cfg.temp_dir,"*");
delfiles(cfg.temp_dir,ALLFILES);
while(online) {
if((useron.misc&(WIP|RIP) || !(useron.misc&EXPERT))
&& (useron.logons<2 || !(useron.rest&FLAG('Q'))))
......@@ -447,13 +447,13 @@ void sbbs_t::qwk_sec()
continue; }
if(ch=='S') {
new_scan_cfg(SUB_CFG_NSCAN);
delfiles(cfg.temp_dir,"*");
delfiles(cfg.temp_dir,ALLFILES);
continue; }
if(ch=='P') {
new_scan_ptr_cfg();
for(i=0;i<cfg.total_subs;i++)
sav_ptr[i]=sub_ptr[i];
delfiles(cfg.temp_dir,"*");
delfiles(cfg.temp_dir,ALLFILES);
continue; }
if(ch=='C') {
while(online) {
......@@ -552,7 +552,7 @@ void sbbs_t::qwk_sec()
useron.qwk^=QWK_BYSELF;
break; }
putuserrec(&cfg,useron.number,U_QWK,8,ultoa(useron.qwk,str,16)); }
delfiles(cfg.temp_dir,"*");
delfiles(cfg.temp_dir,ALLFILES);
continue; }
......@@ -622,7 +622,7 @@ void sbbs_t::qwk_sec()
sprintf(str,"%s%s.qwk",cfg.temp_dir,cfg.sys_id);
remove(str);
unpack_rep();
delfiles(cfg.temp_dir,"*");
delfiles(cfg.temp_dir,ALLFILES);
//autohangup();
}
else {
......@@ -727,7 +727,7 @@ void sbbs_t::qwk_sec()
continue; }
*/
delfiles(cfg.temp_dir,"*");
delfiles(cfg.temp_dir,ALLFILES);
bprintf(text[UploadingREP],cfg.sys_id);
for(k=0;k<cfg.total_fextrs;k++)
if(!stricmp(cfg.fextr[k]->ext,useron.tmpext)
......@@ -748,7 +748,7 @@ void sbbs_t::qwk_sec()
sprintf(tmp,"%s%s.rep",cfg.temp_dir,cfg.sys_id);
if(!mv(str,tmp,0))
unpack_rep();
delfiles(cfg.temp_dir,"*");
delfiles(cfg.temp_dir,ALLFILES);
continue; }
/******************/
......@@ -773,10 +773,10 @@ void sbbs_t::qwk_sec()
sprintf(str,"%s%s.rep",cfg.temp_dir,cfg.sys_id);
protocol(cmdstr(cfg.prot[i]->ulcmd,str,nulstr,NULL),0);
unpack_rep();
delfiles(cfg.temp_dir,"*");
delfiles(cfg.temp_dir,ALLFILES);
//autohangup();
} }
delfiles(cfg.temp_dir,"*");
delfiles(cfg.temp_dir,ALLFILES);
FREE(sav_ptr);
}
......
......@@ -80,7 +80,8 @@ extern "C" {
#ifdef __unix__
#include <glob.h> /* POSIX.2 directory pattern matching function */
#include <glob.h> /* POSIX.2 directory pattern matching function */
#define ALLFILES "*" /* matches all files in a directory */
#else /* glob-compatible findfirst/findnext wrapper */
......@@ -117,6 +118,8 @@ extern "C" {
DLLEXPORT int DLLCALL glob(const char *pattern, int flags, void* unused, glob_t*);
DLLEXPORT void DLLCALL globfree(glob_t*);
#define ALLFILES "*.*" /* matches all files in a directory */
#endif
#ifdef __unix__
......
......@@ -197,7 +197,7 @@ void sbbs_t::temp_xfer()
sys_status&=~SS_ABORT;
break;
case 'F': /* Create a file list */
delfiles(cfg.temp_dir,"*");
delfiles(cfg.temp_dir,ALLFILES);
create_filelist("FILELIST.TXT",0);
if(!(sys_status&SS_ABORT))
logline(nulstr,"Created list of all files");
......@@ -231,7 +231,7 @@ void sbbs_t::temp_xfer()
bprintf(text[TempDirTotal],ultoac(bytes,tmp),files);
break;
case 'N': /* Create a list of new files */
delfiles(cfg.temp_dir,"*");
delfiles(cfg.temp_dir,ALLFILES);
create_filelist("NEWFILES.TXT",FL_ULTIME);
if(!(sys_status&SS_ABORT))
logline(nulstr,"Created list of new files");
......
......@@ -57,9 +57,9 @@ bool sbbs_t::unpack_qwk(char *packet,uint hubnum)
errormsg(WHERE,ERR_LEN,packet,l);
return(false);
}
i=external(cmdstr(cfg.qhub[hubnum]->unpack,packet,"*",NULL),EX_OFFLINE);
i=external(cmdstr(cfg.qhub[hubnum]->unpack,packet,ALLFILES,NULL),EX_OFFLINE);
if(i) {
errormsg(WHERE,ERR_EXEC,cmdstr(cfg.qhub[hubnum]->unpack,packet,"*",NULL),i);
errormsg(WHERE,ERR_EXEC,cmdstr(cfg.qhub[hubnum]->unpack,packet,ALLFILES,NULL),i);
return(false);
}
sprintf(str,"%sMESSAGES.DAT",cfg.temp_dir);
......@@ -271,6 +271,6 @@ bool sbbs_t::unpack_qwk(char *packet,uint hubnum)
closedir(dir);
lprintf("Finished Importing QWK Network Packet: %s",packet);
delfiles(cfg.temp_dir,"*");
delfiles(cfg.temp_dir,ALLFILES);
return(true);
}
......@@ -74,7 +74,7 @@ bool sbbs_t::unpack_rep(char* repfile)
ex=EX_OUTL|EX_OUTR;
if(!online)
ex|=EX_OFFLINE;
i=external(cmdstr(cfg.fextr[k]->cmd,str,"*",NULL),ex);
i=external(cmdstr(cfg.fextr[k]->cmd,str,ALLFILES,NULL),ex);
if(i) {
bputs(text[QWKExtractionFailed]);
logline("U!",AttemptedToUploadREPpacket);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment