home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Jason Aller Floppy Collection
/
341.img
/
TCS161S.ZIP
/
XFERMOD1.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1980-10-06
|
2KB
|
89 lines
procedure acceptfile(tramp:integer);
var process:boolean; dir1,extend:lstr; f1,f2:text; fn1,fn2:mstr; fn3:lstr;
begin
process:=true;
dir1:=copy(area.xmodemdir,1,length(area.xmodemdir)-1);
extend:=copy(fnames[tramp],length(fnames[tramp])-3,4);
extend:=upstring(extend);
write(^R'Received File: '^S+fnames[tramp]);
fn1:=forumdir+'PROCNAME.TXT'; fn2:=forumdir+'PROCMSG.TXT';
assign(f1,fn1); assign(f2,fn2);
if exist(fn1) then erase(f1);
if exist(fn2) then erase(f2);
if process then processfile(fnames[tramp],extend);
if exist(fn1) then begin
reset(f1);
readln(f1,fn3);
close(f1);
fnames[tramp]:=fn3;
end;
if exist(fn2) then begin
reset(f2);
readln(f2,fn3);
close(f2);
write(^S' '+fn3+'... ');
end;
if not exist('c:\workdir\'+fnames[tramp]) then exit;
writeln(^R' posting...');
exec(getenv('COMSPEC'),' /C copy c:\workdir\'+fnames[tramp]+' '+dir1+' >etc.tcs');
exec(getenv('COMSPEC'),' /C del c:\workdir\'+fnames[tramp]+' >etc.tcs');
ud.path:=area.xmodemdir;
ud.filename:=fnames[tramp];
ud.descrip:=fdescs[tramp];
ud.dlpw:=fdlpws[tramp];
ud.extdesc:='Batch U/L - No Description';
writelog(15,2,fnames[tramp]);
buflen:=40;
if ups>32765 then ups:=0;
inc(ups);
ud.sentby:=unam;
ud.when:=now;
ud.whenrated:=now;
ud.points:=0;
ud.downloaded:=0;
ud.newfile:=true;
ud.specialfile:=false;
getfsize(ud); addfile(ud);
inc(urec.uploads);
urec.upk:=urec.upk+ud.filesize;
newuploads:=newuploads+1;
writeurec;
end;
procedure getextras;
var r:registers; ffinfo:searchrec;
tpath:anystr; b:byte; cnt:integer; mm:text;
begin
writeln; writeln(^R'Searching for ',checkwork,' extra file(s).');
writeln;
tpath:='c:\workdir\*.*'; cnt:=0;
findfirst (tpath,$17,ffinfo);
if doserror<>0 then begin
writeln('None Found! Please Alert Sysop!');
exit;
end;
while doserror=0 do begin
if not break then if ffinfo.name[1]<>'.' then begin
fnames[1]:=ffinfo.name;
if answer<>'H' then begin
writeln;
writestr(^R'Describe file '^S+ffinfo.name+^R+': *');
fdescs[1]:=input;
writestr(^R'Download P/W for file: *');
fdlpws[1]:=input;
end else begin
fdescs[1]:='Batch U/L with no description';
fdlpws[1]:='';
end;
acceptfile(1);
end;
findnext (ffinfo)
end;
end;