home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
UTIL
/
WWIVE
/
MYWIVE.ZIP
/
DUPFILE.MOD
< prev
next >
Wrap
Text File
|
1992-12-01
|
3KB
|
112 lines
: Mod to search for duplicate files in ALL directories.....
Name: White Rabbit #102 @8410
Origin: [The Bounty @ 804-780-9622]
Region: [ Virginia ]
Date: Fri Apr 14 14:02:34 1989
A lot of people have been asking for this mod to be done, and it finally is!
This will scan ALL directories for a filename match on the filename entered
to be uploaded. You will find the code section in XFER.C (where else) and
all you need to do is replace the first section of the original code with
the section shown below. Some portions of the original can be used as is,
but I found it a lot easier to just replace the original with the modified
using a block read. One thing it does require now, that was not in the
original code is that the filename must be at least 4 chars long. No more
'A', 'B', etc. files from the Commodore systems. The extension DOES count
in the length requirement, though, making it possible to have a filename of
'A.C64' and the like.
Hope you enjoy it. I know I have!!
White Rabbit
(aka Steve Johns)
void upload(int dn)
{
directoryrec d;
uploadsrec u,u1;
int ocd,i,i1,i2,ok,xfer,f;
char s[81],s1[81],s2[81];
long l;
double ti;
helpl=17;
dliscan1(dn);
d=directories[dn];
if (numf>=d.maxfiles) {
nl();
nl();
pl("This directory is currently full.");
nl();
closedl();
return;
}
nl();
ti=freek1((d.path));
ltoa((long) (ti),s1,10);
strcpy(s,"Upload - ");
strcat(s,s1);
strcat(s,"k free.");
pl(s);
nl();
if (ti<100.0) {
pl("Not enough disk space to upload here.");
nl();
closedl();
return;
}
prt(5,"Enter Name of File (4 chars min.)");
prt(2,"Filename: ");
input(s,12);
if (!okfn(s))
s[0]=0;
ok=0;
xfer=1;
if (strlen(s)>4) {
align(s);
ocd=curdir;
ok=1;
nl();
pl("Standby....Checking for duplicate files....");
nl();
for (i=0; (i<64) && (!hangup) && (udir[i].subnum!=-1); i++) {
i1=udir[i].subnum;
curdir=i;
dliscan();
for (i1=1; (i1<=numf) && (!hangup); i1++) {
SETREC(i1);
read(dlf,(void *)&u,sizeof(uploadsrec));
if (compare(s,u.filename)) {
prt(2,"That file already exists on this system.");
nl();
ok=0;
}
}
closedl();
}
curdir=ocd;
dliscan1(dn);
d=directories[dn];
strcpy(u.filename,s);
u.ownerusr=usernum;
u.ownersys=0;
u.numdloads=0;
u.filetype=0;
u.mask=0;
strcpy(u.upby,nam1(&thisuser,usernum,syscfg.systemnumber));
strcpy(u.date,date());
}
if (ok) { /* from here on can remain intact */
strcpy(s1,"Upload '");
strcat(s1,s);
strcat(s1,"' ? ");
if (strcmp(s," . "))
prt(5,s1);
else
ok=0;}
....and that does it. Told ya it was pretty simple. Anyway, I hope this
some of you who have had this problem develop on your systems with the
duplicate uploads.