/* ** ** BatchFTP.thor - Will create a file suitable for DaFTP processing. ** This scripts assumes that there is only one file ** matching the filename in the database. */ outfile = "ram:FTP" /* Edit at will */ system = "News&Mail" /* Edit to the name of your Internet system in THOR */ FDF_DELETED = '00000001'x options results thorport = address() if ~show('p', 'BBSREAD') then do address command "run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead" "WaitForPort BBSREAD" end address(thorport) GETFILELIST outstem LIST if(rc ~= 0) then do if(rc = 5) then REQUESTNOTIFY TEXT '"Window not open."' BT '"_Ok"' if(rc = 6) then REQUESTNOTIFY TEXT '"No files selected."' BT '"_Ok"' if(rc = 30) then REQUESTNOTIFY TEXT '"'THOR.LASTERROR'"' BT '"_Ok"' exit end outline = "mget" do i=1 to LIST.COUNT drop FILE. /* Important */ address (bbsread) SEARCHBRFILE '"'system'"' FILE SEARCH '"'LIST.FILENAME.i'"' NAME if(rc ~= 0) then do say BBSREAD.LASTERROR exit end if(FILE.FILEAREA.COUNT ~= 0) then do drop FTAGS. drop FDATA. READBRFILE '"'system'"' '"'FILE.FILEAREA.1'"' filenr LIST.FILENR.i tagsstem FTAGS datastem FDATA if(rc ~= 0) then do say BBSREAD.LASTERROR exit end if (bitand(DATA.FLAGS,FDF_DELETED) ~= FDF_DELETED) then outline = outline || ' ' || FILE.FILEAREA.1 || '/' || FTAGS.NAME end end if(open(fh, outfile, W)) then do if(outline ~= "mget") then call writeln(fh, outline) call close(fh) end exit