home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
WWIVMODS
/
MODSUNKN.ZIP
/
FILELIST.MOD
< prev
next >
Wrap
Text File
|
1990-09-18
|
6KB
|
193 lines
Xennon #22 @4357
Wed Aug 29 21:16:19 1990
7[2 Msg Status7 ] 1No reply needed.
7══════════════════════════════════════════════════════════════════════════════
┌─────────────────────────────────────┐
│ Mod #2: Master file list generator! │
└─────────────────────────────────────┘
This concept for this mod was stolen from other BBS programs which
allow the SysOp to generate a master file list for users to D/L.
This mod, creates the list, ZIPs it, and presents it for D/L for the
user. Only the directories in the user's Q-Scan are included. To
generate a 360 file listing on "The Romper Room" requires about 45
seconds, including ZIP time (we run on an 80286/10).
Installation:
At the end of FCNS.H, add the following line:
void master_list();
Save FCNS.H and load BBS.C. Search for the following line(s).
if ((strcmp(s,"UPLOAD")==0) && (dcs()))
uploadall(udir[curdir].subnum);
Add the following lines:
if (strcmp(s,"MASTER")==0)
master_list();
Block copy the following procedure into a seperate file, or append it
to the exisiting XFER.C file. I suggest block saving it to a file named
MASTLIST.C (remember to include it in your project file). You will
want to change the ZIP file name to something suitable for your BBS -
this copy has ROMPROOM.ZIP coded in it. Also, the BBS name in the
header line will need to be customized for your BBS.
/* Master File list generator, version 2.0. Written by Ryan Gran */
/* (aka Kellogg) for WWIV BBS systems. */
#include "vardec.h"
#include "fcns.h"
#include <stdio.h>
#define SETREC(i) lseek(dlf,((long) (i))*((long)sizeof(uploadsrec)),SEEK_SET);
extern int num_dirs, numf, dlf,curdir, num_listed;
extern int hangup;
extern directoryrec directories[64];
extern configrec syscfg;
extern usersubrec udir[64];
extern userrec thisuser;
void master_list()
{
FILE *master, *temp;
int i,i2,i3,pts,ocd,totfiles,extended_info,send,abort;
char s1[81],s2[81],s3[81],ch;
uploadsrec u;
unsigned long totbytes;
char *ss;
long numbytes;
nl();
outstr("2[E]1nhanced or 2[C]1ondensed file listing: 2");
ch=onek("CE");
switch(ch) {
case 'E':
extended_info=1;
break;
case 'C':
extended_info=0;
break;
}
totfiles=0;
totbytes=0;
ocd=curdir;
sprintf(s1, "%sMASTER.LST",syscfg.tempdir);
master = fopen(s1, "wt");
fprintf(master,"\n The Romper Room BBS - Master file listing as of %s\n\n",atime());
nl();
outstr("2Please wait, now creating 1MASTER.LST3.");
for (i=0; (i<=64) && (!hangup); i++) {
pts=0;
if (udir[i].subnum!=-1) {
if (i>=32) {
if (thisuser.nscn2 & (1L << i-32))
pts=1;
} else {
if (thisuser.nscn1 & (1L << i))
pts=1;
}
}
if (pts) {
outstr("3.");
curdir=i;
dliscan();
sprintf(s1, "\n%s - #%s, %d files.\n", directories[udir[i].subnum].name,
udir[i].keys, numf);
fprintf(master,s1);
for(i2=0; i2<=(strlen(s1)-3); i2++)
fprintf(master,"-");
fprintf(master,"\n\n");
totfiles=totfiles+numf;
for(i3=1; i3<=numf; i3++) {
SETREC(i3);
read(dlf,(void *)&u,sizeof(uploadsrec));
fprintf(master,"%s :",u.filename);
ltoa((((u.numbytes)+1023)/1024),s2,10);
fprintf(master," %-4sk :",s2);
fprintf(master," %s\n",u.description);
totbytes=totbytes+u.numbytes;
if (extended_info==1) {
ss=read_extended_description(u.filename);
if (ss) {
sprintf(s1,"%sTEMP.EXT",syscfg.tempdir);
temp=fopen(s1,"wt");
fprintf(temp,"%s",ss);
fclose(temp);
temp=fopen(s1,"rt");
do {
fgets(s2,81,temp);
if (strcmp(s2,s3)==0)
break;
fprintf(master," %s",s2);
stpcpy(s2,s3);
} while (!feof(temp));
fclose(temp);
unlink(s1);
}
farfree(ss);
}
}
}
closedl();
}
nl();
ltoa((((totbytes)+1023)/1024),s2,10);
fprintf(master,"\n %d files, %-6sk bytes\n",totfiles,s2);
numbytes=filelength(master);
fclose(master);
curdir=ocd;
pl("2Now ZIPing MASTER.LST..");
sprintf(s1,"PKZIP -A %sROMPROOM.ZIP %sMASTER.LST",syscfg.tempdir,syscfg.tempdir);
i=run_external1(s1);
sprintf(s1,"%sROMPROOM.ZIP",syscfg.tempdir);
send=0;
abort=0;
nl();
pl("Master file list generation completed. Ready for transfer!");
nl();
send_file(s1, &send, &abort,0,"ROMPROOM.ZIP",-1,numbytes);
topscreen();
sprintf(s1,"%sMASTER.LST",syscfg.tempdir);
unlink(s1);
sprintf(s1,"%sROMPROOM.ZIP",syscfg.tempdir);
unlink(s1);
}
You'll need to Build All, so unless you're fortunate enough to have
access to a '386/'486 ... spend the registration money you want to
send us on a steak dinner.
Look for more modifications by Kellogg & Xennon (or Xennon & Kellogg)!
We hope to start providing the WWIV world with new ideas, such as this
one. We don't request any monitary payment for our modifications
(if you have a spare SystemPro, collecting dust, we could be pursuaded
to accept it), but PLEASE, net mail either of us, or call "The Romper
Room BBS" at (508)/842-2472 (WWIV SysOps will receive automatic
verification!). WWIV SysOps and users are encouraged to net
mail suggestions for modifications as well!
Disclaimer:
It runs perfectly on The Romper Room BBS - if it causes your HD platters
to sublime, or disrupts the flow of time, it's *YOUR* fault. We shall
hold no responsibility for any damages which you might try to blame on
our mods. :> But please, if you encounter a bug (no matter how small!)
net mail us!
WWIVLink WWIVNet
Kellogg #1 @15802 <-> #5 @ 5808
Xennon #4 @15802 <-> #70 @ 5808