Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199508.adf » !Internet » StarterPak/!Newsbase/Transports/ka9q/sendnews
StarterPak/!Newsbase/Transports/ka9q/sendnews
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199508.adf » !Internet |
Filename: | StarterPak/!Newsbase/Transports/ka9q/sendnews |
Read OK: | ✔ |
File size: | 0763 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
10REM >SendNews 20REM takes a news file and copies to outgoing directory 30 40ONERROR REPORT:PRINT" at line ";ERL:END 50SYS"OS_GetEnv" TO A$ 60N$="" 70REPEAT 80p$=FNgetpar(A$," ") 90CASEp$OF 100WHEN"-f":N$=FNgetpar(A$," ") 110ENDCASE 120UNTILA$="" 130IFN$=""THENPROCexit(1,"No file parameter") 140 150PROCcheckdirs 160 170REPEAT 180n$=FNfilename("news",10) 190SYS"XOS_File",17,"<Mail$dir>.spool.newsqueue.badmarker."+n$ TOt1%;F% 200SYS"XOS_File",17,"<Mail$dir>.spool.newsqueue.articles."+n$ TOt2%;F% 210UNTILt1%+t2%=0 OR(F%AND1) 220IF(F%AND1) PROCexit(1,"Name generation error") 230 240F%=FNmovefile(N$,"<Mail$dir>.spool.newsqueue.badmarker."+n$) 250IF(F%AND1) PROCexit(1,"File move failed (spool area)") 260F%=FNcopyfile("<Mail$dir>.spool.newsqueue.badmarker."+n$,"<Mail$dir>.spool.newsqueue.articles."+n$) 270IF(F%AND1) PROCexit(1,"File copy failed (spool area)") 280OSCLI"remove "+N$ 290PROCexit(0,"Article posted") 300END 310 320DEFFNfilename(A$,len%) 330=A$+RIGHT$(STR$~TIME,len%-LENA$) 340 350DEFFNmovefile(s$,d$) 360LOCALF%:SYS"XOS_FSControl",25,s$,d$TO;F% 370IF(F%AND1) SYS"XOS_FSControl",26,s$,d$,(1<<7) TO;F% 380=(F%AND1) 390 400DEFFNcopyfile(s$,d$) 410SYS"XOS_FSControl",26,s$,d$ TO;F% 420=(F%AND1) 430 440DEFPROCexit(n%,a$) 450OSCLI("set NewsBase$ReturnCode "+STR$n%) 460OSCLI("set NewsBase$ReturnInfo "+a$) 470END 480ENDPROC 490 500DEFPROCcheckdirs 510IFFNobjtype("<Mail$dir>")<2 PROCexit(1,"!MailDir not found") 520PROCensuredir("<Mail$dir>.spool") 530PROCensuredir("<Mail$dir>.spool.newsqueue") 540PROCensuredir("<Mail$dir>.spool.newsqueue.badmarker") 550PROCensuredir("<Mail$dir>.spool.newsqueue.articles") 560IFFNobjtype("<Mail$dir>.spool.newsqueue.badmarker")<2 ORFNobjtype("<Mail$dir>.spool.newsqueue.articles")<2 THENPROCexit(1,"NNTP spool directories not created") 570ENDPROC 580 590DEFPROCensuredir(f$) 600LOCALt% 610t%=FNobjtype(f$) 620IFt%<2ORt%>3THENSYS"XOS_File",8,f$ 630ENDPROC 640 650DEFFNobjtype(f$) 660LOCALF% 670SYS"XOS_File",17,f$TOt%;F% 680IF(F%AND1)THEN=-1:ELSE=t% 690 700DEFFNgetpar(RETURN A$,s$) 710LOCALB$,l% 720l%=INSTR(A$,s$) 730IFl%>0THEN 740 B$=LEFT$(A$,l%-1):A$=MID$(A$,l%+1) 750 ELSE 760 B$=A$:A$="" 770ENDIF 780=B$
� >SendNews 8� takes a news file and copies to outgoing directory (� �:�" at line ";�:� 2ș"OS_GetEnv" � A$ < N$="" F� Pp$=�getpar(A$," ") Z Ȏp$� d�"-f":N$=�getpar(A$," ") n� x �A$="" �'�N$=""��exit(1,"No file parameter") � ��checkdirs � �� �n$=�filename("news",10) �Fș"XOS_File",17,"<Mail$dir>.spool.newsqueue.badmarker."+n$ �t1%;F% �Eș"XOS_File",17,"<Mail$dir>.spool.newsqueue.articles."+n$ �t2%;F% ��t1%+t2%=0 �(F%�1) �,�(F%�1) �exit(1,"Name generation error") � �?F%=�movefile(N$,"<Mail$dir>.spool.newsqueue.badmarker."+n$) �4�(F%�1) �exit(1,"File move failed (spool area)") fF%=�copyfile("<Mail$dir>.spool.newsqueue.badmarker."+n$,"<Mail$dir>.spool.newsqueue.articles."+n$) 4�(F%�1) �exit(1,"File copy failed (spool area)") �"remove "+N$ "�exit(0,"Article posted") ,� 6 @ݤfilename(A$,len%) J=A$+��~�,len%-�A$) T ^ݤmovefile(s$,d$) h&�F%:ș"XOS_FSControl",25,s$,d$�;F% r2�(F%�1) ș"XOS_FSControl",26,s$,d$,(1<<7) �;F% |=(F%�1) � �ݤcopyfile(s$,d$) �#ș"XOS_FSControl",26,s$,d$ �;F% �=(F%�1) � ���exit(n%,a$) �%�("set NewsBase$ReturnCode "+�n%) �$�("set NewsBase$ReturnInfo "+a$) �� �� � ���checkdirs �;�objtype("<Mail$dir>")<2 �exit(1,"!MailDir not found") "�ensuredir("<Mail$dir>.spool") ,�ensuredir("<Mail$dir>.spool.newsqueue") 6�ensuredir("<Mail$dir>.spool.newsqueue.badmarker") &5�ensuredir("<Mail$dir>.spool.newsqueue.articles") 0��objtype("<Mail$dir>.spool.newsqueue.badmarker")<2 ��objtype("<Mail$dir>.spool.newsqueue.articles")<2 ��exit(1,"NNTP spool directories not created") :� D N��ensuredir(f$) X�t% bt%=�objtype(f$) l �t%<2�t%>3�ș"XOS_File",8,f$ v� � �ݤobjtype(f$) ��F% �ș"XOS_File",17,f$�t%;F% ��(F%�1)�=-1:�=t% � �ݤgetpar(� A$,s$) � �B$,l% �l%=�A$,s$) � �l%>0� � B$=�A$,l%-1):A$=�A$,l%+1) � � � B$=A$:A$="" � =B$ �
00000000 0d 00 0a 0f f4 20 3e 53 65 6e 64 4e 65 77 73 0d |..... >SendNews.| 00000010 00 14 38 f4 20 74 61 6b 65 73 20 61 20 6e 65 77 |..8. takes a new| 00000020 73 20 66 69 6c 65 20 61 6e 64 20 63 6f 70 69 65 |s file and copie| 00000030 73 20 74 6f 20 6f 75 74 67 6f 69 6e 67 20 64 69 |s to outgoing di| 00000040 72 65 63 74 6f 72 79 0d 00 1e 04 0d 00 28 19 ee |rectory......(..| 00000050 85 20 f6 3a f1 22 20 61 74 20 6c 69 6e 65 20 22 |. .:." at line "| 00000060 3b 9e 3a e0 0d 00 32 16 c8 99 22 4f 53 5f 47 65 |;.:...2..."OS_Ge| 00000070 74 45 6e 76 22 20 b8 20 41 24 0d 00 3c 09 4e 24 |tEnv" . A$..<.N$| 00000080 3d 22 22 0d 00 46 05 f5 0d 00 50 16 70 24 3d a4 |=""..F....P.p$=.| 00000090 67 65 74 70 61 72 28 41 24 2c 22 20 22 29 0d 00 |getpar(A$," ")..| 000000a0 5a 09 c8 8e 70 24 ca 0d 00 64 1c c9 22 2d 66 22 |Z...p$...d.."-f"| 000000b0 3a 4e 24 3d a4 67 65 74 70 61 72 28 41 24 2c 22 |:N$=.getpar(A$,"| 000000c0 20 22 29 0d 00 6e 05 cb 0d 00 78 0a fd 41 24 3d | ")..n....x..A$=| 000000d0 22 22 0d 00 82 27 e7 4e 24 3d 22 22 8c f2 65 78 |""...'.N$=""..ex| 000000e0 69 74 28 31 2c 22 4e 6f 20 66 69 6c 65 20 70 61 |it(1,"No file pa| 000000f0 72 61 6d 65 74 65 72 22 29 0d 00 8c 04 0d 00 96 |rameter").......| 00000100 0e f2 63 68 65 63 6b 64 69 72 73 0d 00 a0 04 0d |..checkdirs.....| 00000110 00 aa 05 f5 0d 00 b4 1b 6e 24 3d a4 66 69 6c 65 |........n$=.file| 00000120 6e 61 6d 65 28 22 6e 65 77 73 22 2c 31 30 29 0d |name("news",10).| 00000130 00 be 46 c8 99 22 58 4f 53 5f 46 69 6c 65 22 2c |..F.."XOS_File",| 00000140 31 37 2c 22 3c 4d 61 69 6c 24 64 69 72 3e 2e 73 |17,"<Mail$dir>.s| 00000150 70 6f 6f 6c 2e 6e 65 77 73 71 75 65 75 65 2e 62 |pool.newsqueue.b| 00000160 61 64 6d 61 72 6b 65 72 2e 22 2b 6e 24 20 b8 74 |admarker."+n$ .t| 00000170 31 25 3b 46 25 0d 00 c8 45 c8 99 22 58 4f 53 5f |1%;F%...E.."XOS_| 00000180 46 69 6c 65 22 2c 31 37 2c 22 3c 4d 61 69 6c 24 |File",17,"<Mail$| 00000190 64 69 72 3e 2e 73 70 6f 6f 6c 2e 6e 65 77 73 71 |dir>.spool.newsq| 000001a0 75 65 75 65 2e 61 72 74 69 63 6c 65 73 2e 22 2b |ueue.articles."+| 000001b0 6e 24 20 b8 74 32 25 3b 46 25 0d 00 d2 16 fd 74 |n$ .t2%;F%.....t| 000001c0 31 25 2b 74 32 25 3d 30 20 84 28 46 25 80 31 29 |1%+t2%=0 .(F%.1)| 000001d0 0d 00 dc 2c e7 28 46 25 80 31 29 20 f2 65 78 69 |...,.(F%.1) .exi| 000001e0 74 28 31 2c 22 4e 61 6d 65 20 67 65 6e 65 72 61 |t(1,"Name genera| 000001f0 74 69 6f 6e 20 65 72 72 6f 72 22 29 0d 00 e6 04 |tion error")....| 00000200 0d 00 f0 3f 46 25 3d a4 6d 6f 76 65 66 69 6c 65 |...?F%=.movefile| 00000210 28 4e 24 2c 22 3c 4d 61 69 6c 24 64 69 72 3e 2e |(N$,"<Mail$dir>.| 00000220 73 70 6f 6f 6c 2e 6e 65 77 73 71 75 65 75 65 2e |spool.newsqueue.| 00000230 62 61 64 6d 61 72 6b 65 72 2e 22 2b 6e 24 29 0d |badmarker."+n$).| 00000240 00 fa 34 e7 28 46 25 80 31 29 20 f2 65 78 69 74 |..4.(F%.1) .exit| 00000250 28 31 2c 22 46 69 6c 65 20 6d 6f 76 65 20 66 61 |(1,"File move fa| 00000260 69 6c 65 64 20 28 73 70 6f 6f 6c 20 61 72 65 61 |iled (spool area| 00000270 29 22 29 0d 01 04 66 46 25 3d a4 63 6f 70 79 66 |)")...fF%=.copyf| 00000280 69 6c 65 28 22 3c 4d 61 69 6c 24 64 69 72 3e 2e |ile("<Mail$dir>.| 00000290 73 70 6f 6f 6c 2e 6e 65 77 73 71 75 65 75 65 2e |spool.newsqueue.| 000002a0 62 61 64 6d 61 72 6b 65 72 2e 22 2b 6e 24 2c 22 |badmarker."+n$,"| 000002b0 3c 4d 61 69 6c 24 64 69 72 3e 2e 73 70 6f 6f 6c |<Mail$dir>.spool| 000002c0 2e 6e 65 77 73 71 75 65 75 65 2e 61 72 74 69 63 |.newsqueue.artic| 000002d0 6c 65 73 2e 22 2b 6e 24 29 0d 01 0e 34 e7 28 46 |les."+n$)...4.(F| 000002e0 25 80 31 29 20 f2 65 78 69 74 28 31 2c 22 46 69 |%.1) .exit(1,"Fi| 000002f0 6c 65 20 63 6f 70 79 20 66 61 69 6c 65 64 20 28 |le copy failed (| 00000300 73 70 6f 6f 6c 20 61 72 65 61 29 22 29 0d 01 18 |spool area)")...| 00000310 11 ff 22 72 65 6d 6f 76 65 20 22 2b 4e 24 0d 01 |.."remove "+N$..| 00000320 22 1d f2 65 78 69 74 28 30 2c 22 41 72 74 69 63 |"..exit(0,"Artic| 00000330 6c 65 20 70 6f 73 74 65 64 22 29 0d 01 2c 05 e0 |le posted")..,..| 00000340 0d 01 36 04 0d 01 40 17 dd a4 66 69 6c 65 6e 61 |..6...@...filena| 00000350 6d 65 28 41 24 2c 6c 65 6e 25 29 0d 01 4a 16 3d |me(A$,len%)..J.=| 00000360 41 24 2b c2 c3 7e 91 2c 6c 65 6e 25 2d a9 41 24 |A$+..~.,len%-.A$| 00000370 29 0d 01 54 04 0d 01 5e 15 dd a4 6d 6f 76 65 66 |)..T...^...movef| 00000380 69 6c 65 28 73 24 2c 64 24 29 0d 01 68 26 ea 46 |ile(s$,d$)..h&.F| 00000390 25 3a c8 99 22 58 4f 53 5f 46 53 43 6f 6e 74 72 |%:.."XOS_FSContr| 000003a0 6f 6c 22 2c 32 35 2c 73 24 2c 64 24 b8 3b 46 25 |ol",25,s$,d$.;F%| 000003b0 0d 01 72 32 e7 28 46 25 80 31 29 20 c8 99 22 58 |..r2.(F%.1) .."X| 000003c0 4f 53 5f 46 53 43 6f 6e 74 72 6f 6c 22 2c 32 36 |OS_FSControl",26| 000003d0 2c 73 24 2c 64 24 2c 28 31 3c 3c 37 29 20 b8 3b |,s$,d$,(1<<7) .;| 000003e0 46 25 0d 01 7c 0b 3d 28 46 25 80 31 29 0d 01 86 |F%..|.=(F%.1)...| 000003f0 04 0d 01 90 15 dd a4 63 6f 70 79 66 69 6c 65 28 |.......copyfile(| 00000400 73 24 2c 64 24 29 0d 01 9a 23 c8 99 22 58 4f 53 |s$,d$)...#.."XOS| 00000410 5f 46 53 43 6f 6e 74 72 6f 6c 22 2c 32 36 2c 73 |_FSControl",26,s| 00000420 24 2c 64 24 20 b8 3b 46 25 0d 01 a4 0b 3d 28 46 |$,d$ .;F%....=(F| 00000430 25 80 31 29 0d 01 ae 04 0d 01 b8 11 dd f2 65 78 |%.1)..........ex| 00000440 69 74 28 6e 25 2c 61 24 29 0d 01 c2 25 ff 28 22 |it(n%,a$)...%.("| 00000450 73 65 74 20 4e 65 77 73 42 61 73 65 24 52 65 74 |set NewsBase$Ret| 00000460 75 72 6e 43 6f 64 65 20 22 2b c3 6e 25 29 0d 01 |urnCode "+.n%)..| 00000470 cc 24 ff 28 22 73 65 74 20 4e 65 77 73 42 61 73 |.$.("set NewsBas| 00000480 65 24 52 65 74 75 72 6e 49 6e 66 6f 20 22 2b 61 |e$ReturnInfo "+a| 00000490 24 29 0d 01 d6 05 e0 0d 01 e0 05 e1 0d 01 ea 04 |$)..............| 000004a0 0d 01 f4 0f dd f2 63 68 65 63 6b 64 69 72 73 0d |......checkdirs.| 000004b0 01 fe 3b e7 a4 6f 62 6a 74 79 70 65 28 22 3c 4d |..;..objtype("<M| 000004c0 61 69 6c 24 64 69 72 3e 22 29 3c 32 20 f2 65 78 |ail$dir>")<2 .ex| 000004d0 69 74 28 31 2c 22 21 4d 61 69 6c 44 69 72 20 6e |it(1,"!MailDir n| 000004e0 6f 74 20 66 6f 75 6e 64 22 29 0d 02 08 22 f2 65 |ot found")...".e| 000004f0 6e 73 75 72 65 64 69 72 28 22 3c 4d 61 69 6c 24 |nsuredir("<Mail$| 00000500 64 69 72 3e 2e 73 70 6f 6f 6c 22 29 0d 02 12 2c |dir>.spool")...,| 00000510 f2 65 6e 73 75 72 65 64 69 72 28 22 3c 4d 61 69 |.ensuredir("<Mai| 00000520 6c 24 64 69 72 3e 2e 73 70 6f 6f 6c 2e 6e 65 77 |l$dir>.spool.new| 00000530 73 71 75 65 75 65 22 29 0d 02 1c 36 f2 65 6e 73 |squeue")...6.ens| 00000540 75 72 65 64 69 72 28 22 3c 4d 61 69 6c 24 64 69 |uredir("<Mail$di| 00000550 72 3e 2e 73 70 6f 6f 6c 2e 6e 65 77 73 71 75 65 |r>.spool.newsque| 00000560 75 65 2e 62 61 64 6d 61 72 6b 65 72 22 29 0d 02 |ue.badmarker")..| 00000570 26 35 f2 65 6e 73 75 72 65 64 69 72 28 22 3c 4d |&5.ensuredir("<M| 00000580 61 69 6c 24 64 69 72 3e 2e 73 70 6f 6f 6c 2e 6e |ail$dir>.spool.n| 00000590 65 77 73 71 75 65 75 65 2e 61 72 74 69 63 6c 65 |ewsqueue.article| 000005a0 73 22 29 0d 02 30 99 e7 a4 6f 62 6a 74 79 70 65 |s")..0...objtype| 000005b0 28 22 3c 4d 61 69 6c 24 64 69 72 3e 2e 73 70 6f |("<Mail$dir>.spo| 000005c0 6f 6c 2e 6e 65 77 73 71 75 65 75 65 2e 62 61 64 |ol.newsqueue.bad| 000005d0 6d 61 72 6b 65 72 22 29 3c 32 20 84 a4 6f 62 6a |marker")<2 ..obj| 000005e0 74 79 70 65 28 22 3c 4d 61 69 6c 24 64 69 72 3e |type("<Mail$dir>| 000005f0 2e 73 70 6f 6f 6c 2e 6e 65 77 73 71 75 65 75 65 |.spool.newsqueue| 00000600 2e 61 72 74 69 63 6c 65 73 22 29 3c 32 20 8c f2 |.articles")<2 ..| 00000610 65 78 69 74 28 31 2c 22 4e 4e 54 50 20 73 70 6f |exit(1,"NNTP spo| 00000620 6f 6c 20 64 69 72 65 63 74 6f 72 69 65 73 20 6e |ol directories n| 00000630 6f 74 20 63 72 65 61 74 65 64 22 29 0d 02 3a 05 |ot created")..:.| 00000640 e1 0d 02 44 04 0d 02 4e 13 dd f2 65 6e 73 75 72 |...D...N...ensur| 00000650 65 64 69 72 28 66 24 29 0d 02 58 07 ea 74 25 0d |edir(f$)..X..t%.| 00000660 02 62 13 74 25 3d a4 6f 62 6a 74 79 70 65 28 66 |.b.t%=.objtype(f| 00000670 24 29 0d 02 6c 20 e7 74 25 3c 32 84 74 25 3e 33 |$)..l .t%<2.t%>3| 00000680 8c c8 99 22 58 4f 53 5f 46 69 6c 65 22 2c 38 2c |..."XOS_File",8,| 00000690 66 24 0d 02 76 05 e1 0d 02 80 04 0d 02 8a 11 dd |f$..v...........| 000006a0 a4 6f 62 6a 74 79 70 65 28 66 24 29 0d 02 94 07 |.objtype(f$)....| 000006b0 ea 46 25 0d 02 9e 1c c8 99 22 58 4f 53 5f 46 69 |.F%......"XOS_Fi| 000006c0 6c 65 22 2c 31 37 2c 66 24 b8 74 25 3b 46 25 0d |le",17,f$.t%;F%.| 000006d0 02 a8 14 e7 28 46 25 80 31 29 8c 3d 2d 31 3a 8b |....(F%.1).=-1:.| 000006e0 3d 74 25 0d 02 b2 04 0d 02 bc 15 dd a4 67 65 74 |=t%..........get| 000006f0 70 61 72 28 f8 20 41 24 2c 73 24 29 0d 02 c6 0a |par(. A$,s$)....| 00000700 ea 42 24 2c 6c 25 0d 02 d0 0e 6c 25 3d a7 41 24 |.B$,l%....l%=.A$| 00000710 2c 73 24 29 0d 02 da 0a e7 6c 25 3e 30 8c 0d 02 |,s$).....l%>0...| 00000720 e4 1f 20 20 42 24 3d c0 41 24 2c 6c 25 2d 31 29 |.. B$=.A$,l%-1)| 00000730 3a 41 24 3d c1 41 24 2c 6c 25 2b 31 29 0d 02 ee |:A$=.A$,l%+1)...| 00000740 07 20 20 cc 0d 02 f8 11 20 20 42 24 3d 41 24 3a |. ..... B$=A$:| 00000750 41 24 3d 22 22 0d 03 02 05 cd 0d 03 0c 07 3d 42 |A$="".........=B| 00000760 24 0d ff |$..| 00000763