* FILES.KEX 1.0 written by Frank Ellermann * * This macro helps to update FILES.BBS files as used in many BBS. * It searches an existing FILES.BBS for all files in its current * directory not already mentioned in FILES.BBS (so called orphans) * and adds them at the end of FILES.BBS, where you may edit known * missing descriptions as you like. * * assumptions: * file names follow 8+3 DOS style and case doesn't matter. * FILES.BBS entries may contain wild cards '?' and '*'. * FILES.BBS entries without valid description show '-/-' * as info text, this can be modified in variable BBSNONE. * Other sysops prefer descriptions like 'in backup' etc. * * For a test rename your FILES.BBS to FILES.$$$ and modify * the variable BBSFILE to end up in '.$$$' instead of '.BBS' bbsnone = '-/-' bbsname = 'FILES' bbspath = fmode.1() || fpath.1() || '\' bbsfile = bbspath || bbsname || '.BBS' bbs_dir = bbspath || bbsname || '.DIR' olddisk = dir.1() ; 'CHDR' bbspath oldpath = dir.1() ; 'CHD' fpath.1() * leave BBS_DIR if necessary, verify existence of BBSFILE 'XEDIT' bbs_dir '(NOMSG' ; 'QQUIT' 'XEDIT' bbsfile '(NOMSG' ; 'LOCATE :1' if eof.1() = 'ON' then do 'QQUIT' ; 'DIR' 'CHD' oldpath ; 'CHDR' olddisk 'EMSG' bbsfile 'not found or empty' exit 1 end * create new BBS_DIR, remove subdirectories 'DIR (NOMSG' ; 'SET MSGMODE OFF' ; 'SET FNAME' bbsname 'ZONE 17 25' ; 'ALL ,,' if rc = 0 | rc = 1 then 'DEL ALL' ; 'ALL' ; 'ZONE 1 *' 'LOCATE :1' * remove all infos except from name and extension 'CLOCATE :4' ; 'MARK BOX ANCHOR' ; 'BOTTOM' ; 'CLOCATE :15' ; 'MARK BOX' 'UPPER BLOCK' ; 'PUT BLOCK' ; 'DEL ALL' ; 'GET' * remove blanks between name and extension, sort BBS_DIR 'SET ARBCHAR ON * ?' ; 'CHANGE , *.,., ALL' ; 'SORT ALL' * remove all files having the same name as BBSFILE 'ZONE 1' length( bbsname ) + 1 ; 'ALL ,' || bbsname || '.,' if rc = 0 | rc = 1 then 'DEL ALL' ; 'ALL' ; 'ZONE 1 *' 'SET CASE MIXED IGNORE' * for all lines in BBSFILE 'XEDIT' bbsfile '(NOMSG' do while eof.1() <> 'ON' 'CLOCATE :1' ; file = focusword.2() 'CLOCATE :16' * delete lines with missing descrition if focusword.2() = bbsnone then 'DEL' else do 'NEXT' * remove files in BSS_DIR found in BBSFILE 'XEDIT' bbs_dir '(NOMSG' ; 'TOP' do until rc <> 0 'TFIND ,' || file || ',' if rc = 0 then 'DEL' end 'XEDIT' bbsfile '(NOMSG' end end * add missing description info to files left in BBS_DIR 'XEDIT' bbs_dir '(NOMSG'; 'TOP' 'CLOCATE :14' ; 'SET = COVERLAY' bbsnone ; 'REPEAT *' * add BBS_DIR to BBSFILE and quit BBS_DIR anyway 'PUTD ALL' ; 'QQUIT' ; 'XEDIT' bbsfile line = line.1() ; 'GET' ; 'LOCATE :' || line 'CHD' oldpath ; 'CHDR' olddisk 'MSGMODE ON'