From: MERC::"uunet!VM1.NoDak.EDU!ANU-NEWS" 28-MAY-1992 17:01:13.82 To: Multiple recipients of list ANU-NEWS CC: Subj: How I Batched ANU Output Articles One of the problems I have had with ANU news passing news articles on to other sites is it's lack of article batching. Each article to be passed to the next site generates a unique UUCP request. The number of files in my UUCP_SPOOL directory was quite impressive at times. The effective UUCP transfer rate was quite low due to file handling overhead. I started with ANU 6.0 and patched my copy to 6.0-3. The NEWSSKIM command file did not provide for any batching. Hence, doing what any stubborn programmer does, I wrote a batching facility. A new method type, UUCP$CMPRS$BATCH, was created. The NEWS.SYS file then points to the directory, NEWS_MANAGER_DEV:[POST_UUCP$CMPRS$BATCH_nextsite]. I have listed below the PORTIONS of NEWSSKIM.COM which controls the batching. (As you critique the code, remember, it works for me! :-) The FDL file is needed to create a file of the same type as the article output files created by ANU NEWS. The APPEND command appreciates having similar types of files to mash together. :) Improvements will be greatly appreciated!! -- =================================================================== Fred LaForest UUCP: flaforest@vtrm01.UUCP Vickers, Inc. GEnie: FALAFOREST Troy, MI 48007-0302 Compuserve: 70337,2344 My opinions and views are my own and not those of Vickers, inc. (But, that should be quite obvious!) =================================================================== ****************** (NEWSSKIM.COM fragments) $ ! $ !********************************************************************** $ ! Copy news items to other sites $ ! ............... $ ! Search for all directories of the form: $ ! d) UUCP$CMPRS - Compressed batch UUCP copies to 'rnews' on the $ ! remote site. $ ! in both of the above cases, 'node' is the uucp hostname. $ ! d1) UUCP$CMPRS$BATCH - Same as UUCP$CMPRS, but, multiple articles ** $ ! as combined into fewer compressed output files. ** $ ! e) COMMAND - Local site provided transport implemented by the $ ! ****************** ( Add "**" marked lines to search_1 .. search_2 area ) $ bfsiz = 0 ! Nothing batched yet ! ** $ MAXBATBLKS = 200 ! Maximum size of uncompressed batch file ** $ ! in blocks. Assumption #1, compress will ** $ ! normally halve the file size. I wanted to ** $ ! keep the max size of compressed files under ** $ ! 50K bytes. ** $ $ ! note -- where multiple versions of files exist, the following code $ ! picks them up in *ascending order by version number*, so that they $ ! get forwarded in the order received. This enhancement by Mark $ ! Pizzolato, mark@infopiz.uucp . $ $ search_2: $ ver = ver + 1 $ if (ver.gt.versions) .and. (bfsiz .gt. 0) ! All done? ! ** $ then ! ** $ batch_file = f$parse(file,,,"DEVICE") + - ! ** f$parse(file,,,"DIRECTORY") + "MULTI$BATCH.OUT" ! ** $ compress -fcpv 'batch_file' >'batch_file'_COMPRESSED ! ** $ uux_rnews 'node' 'batch_file'_COMPRESSED ! ** $ delete 'batch_file';* ! ** $ delete 'batch_file'_COMPRESSED;* ! ** $ bfsiz = 0 ! ** $ endif ! ** $ if (ver.gt.versions) then goto search_1 ! ** $ ****************** ( Place this code just after the UUCP$CMPRS method code ) $ ! $ UUCP$CMPRS$BATCH_METHOD: ! Compress UUCP NEWS - Multiple article per batch $ batch_file = f$parse(file,,,"DEVICE") + - f$parse(file,,,"DIRECTORY") + "MULTI$BATCH.OUT" $ fsiz = f$file_attributes(file,"EOF") $ if ((bfsiz + fsiz) .gt. MAXBATBLKS) ! Max output file size? $ then $ compress -fcpv 'batch_file' >'batch_file'_COMPRESSED $ uux_rnews 'node' 'batch_file'_COMPRESSED $ delete 'batch_file';* $ delete 'batch_file'_COMPRESSED;* $ bfsiz = 0 $ endif $ if (bfsiz .eq. 0) $ then $ create/fdl=news_manager:news_article_out.fdl 'batch_file' $ endif $ open/append BOUT 'batch_file' $ write BOUT f$fao("#!! rnews !UL", fsiz*512) $ close BOUT $ append 'file' 'batch_file' $ bfsiz = bfsiz + fsiz $ goto delete_it $ ****************** ( FDL File: NEWS_MANAGER:NEWS_ARTICLE_OUT.FDL ) IDENT "18-MAY-1992 14:30:29 VAX/VMS ANALYZE/RMS_FILE Utility" SYSTEM SOURCE VAX/VMS FILE BEST_TRY_CONTIGUOUS yes CONTIGUOUS no EXTENSION 90 FILE_MONITORING no GLOBAL_BUFFER_COUNT 0 ORGANIZATION sequential RECORD BLOCK_SPAN yes CARRIAGE_CONTROL carriage_return FORMAT variable SIZE 0 **************** ( End of Code Stuff )