home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
WWIVMODS
/
MODSUNKN.ZIP
/
RENXFER.MOD
< prev
next >
Wrap
Text File
|
1992-01-29
|
2KB
|
75 lines
Modification to //REN in the Xfer section.
Well, I got sick of the BBS only allowing me to change one filename or
description on the //REN xfer command. So, below is my version which will
loop through all files if a pattern is given to the "File to rename:"
prompt.
Just take the code below and replace the entire subroutine in XFER.C
The Black Dragon.
Black Dragon Enterprises.
*/
void rename_file()
{
char s[81],s0[81],s1[81],s2[81];
int count,i;
uploadsrec u;
nl();
nl();
prt(2,"File to rename: ");
input(s,12);
if (!s[0])
return;
if (strchr(s,'.')==NULL)
strcat(s,".*");
align(s);
dliscan();
nl();
count=0;
i=recno(s);
while ((i>0) && !hangup) {
SETREC(i);
read(dlf,(void *)&u,sizeof(uploadsrec));
printfileinfo(&u);
nl();
prt(2,"New filename? ");
input(s0,12);
if (s0[0]) {
align(s0);
if (strcmp(s0," . ")) {
strcpy(s1,directories[udir[curdir].subnum].path);
strcpy(s2,s1);
strcat(s1,s0);
if (exist(s1))
pl("Filename already in use; not changed.");
else {
strcat(s2,u.filename);
rename(s2,s1);
if (exist(s1))
strcpy(u.filename,s0);
else
pl("Bad filename.");
}
}
}
nl();
pl("New description:");
prt(2,": ");
inputl(s0,58);
if (s0[0]) {
strcpy(u.description,s0);
}
SETREC(i);
write(dlf,(void *)&u,sizeof(uploadsrec));
i=nrecno(s,i);
count++;
}
if (count) {
sprintf(s,"%d file(s) found",count);
pl(s);
}
else
pl("No files found.");
closedl();
}