home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: SHell self-extracting ARchive
(archive/shar).
You can browse this item here: 1073
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Newsgroup Content (archive/news)
| magic
| Supported |
100%
| dexvert
| SHell self-extracting ARchive (archive/shar)
| magic
| Supported |
100%
| dexvert
| Internet Message Format (text/imf)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| news or mail, ASCII text
| default
| |
100%
| TrID
| E-Mail message (Var. 2)
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/329 Shell Archive Format
| default
| |
100%
| gt2
| HTML (Hyper Text Markup Language) Datei
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| message/rfc822
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 72 6f 6d 3a 20 72 61 | 65 25 61 6c 69 61 73 40 |From: ra|e%alias@|
|00000010| 63 73 72 69 2e 74 6f 72 | 6f 6e 74 6f 2e 65 64 75 |csri.tor|onto.edu|
|00000020| 20 28 52 65 69 64 20 45 | 6c 6c 69 73 29 0a 4e 65 | (Reid E|llis).Ne|
|00000030| 77 73 67 72 6f 75 70 73 | 3a 20 63 6f 6d 70 2e 6c |wsgroups|: comp.l|
|00000040| 61 6e 67 2e 70 65 72 6c | 2c 61 6c 74 2e 73 6f 75 |ang.perl|,alt.sou|
|00000050| 72 63 65 73 0a 53 75 62 | 6a 65 63 74 3a 20 62 75 |rces.Sub|ject: bu|
|00000060| 66 66 65 72 69 6e 67 20 | 61 6e 64 20 61 20 6e 65 |ffering |and a ne|
|00000070| 77 73 20 61 72 63 68 69 | 76 65 72 0a 4d 65 73 73 |ws archi|ver.Mess|
|00000080| 61 67 65 2d 49 44 3a 20 | 3c 38 31 34 40 61 6c 69 |age-ID: |<814@ali|
|00000090| 61 73 2e 55 55 43 50 3e | 0a 44 61 74 65 3a 20 32 |as.UUCP>|.Date: 2|
|000000a0| 36 20 4d 61 72 20 39 30 | 20 32 30 3a 34 38 3a 33 |6 Mar 90| 20:48:3|
|000000b0| 38 20 47 4d 54 0a 0a 41 | 20 70 72 6f 62 6c 65 6d |8 GMT..A| problem|
|000000c0| 20 61 6e 64 20 61 20 70 | 72 6f 67 72 61 6d 2e 0a | and a p|rogram..|
|000000d0| 0a 54 68 65 20 70 72 6f | 62 6c 65 6d 20 2d 0a 0a |.The pro|blem -..|
|000000e0| 20 20 20 20 49 20 68 61 | 76 65 20 61 20 70 72 6f | I ha|ve a pro|
|000000f0| 67 72 61 6d 20 74 68 61 | 74 20 61 72 63 68 69 76 |gram tha|t archiv|
|00000100| 65 73 20 61 6c 6c 20 6f | 66 20 74 68 65 20 73 6f |es all o|f the so|
|00000110| 75 72 63 65 20 67 72 6f | 75 70 73 20 66 6f 72 20 |urce gro|ups for |
|00000120| 6d 65 20 61 74 0a 20 20 | 20 20 6e 69 67 68 74 20 |me at. | night |
|00000130| 5b 63 6f 6d 70 2e 73 6f | 75 72 63 65 73 2e 2a 5d |[comp.so|urces.*]|
|00000140| 20 77 68 69 63 68 20 75 | 73 65 73 20 61 6e 20 27 | which u|ses an '|
|00000150| 72 63 27 20 66 69 6c 65 | 20 69 6e 20 74 68 65 20 |rc' file| in the |
|00000160| 68 6f 6d 65 0a 20 20 20 | 20 64 69 72 65 63 74 6f |home. | directo|
|00000170| 72 79 2e 20 20 54 68 65 | 20 70 72 6f 67 72 61 6d |ry. The| program|
|00000180| 20 69 73 20 63 61 6c 6c | 65 64 20 27 6e 61 72 63 | is call|ed 'narc|
|00000190| 27 20 61 6e 64 20 74 68 | 65 20 72 63 20 66 69 6c |' and th|e rc fil|
|000001a0| 65 20 69 73 20 6e 61 6d | 65 64 0a 20 20 20 20 27 |e is nam|ed. '|
|000001b0| 2e 6e 61 72 63 72 63 27 | 20 61 6e 64 20 65 76 65 |.narcrc'| and eve|
|000001c0| 72 79 74 69 6d 65 20 49 | 20 72 75 6e 20 6e 61 72 |rytime I| run nar|
|000001d0| 63 2c 20 77 68 69 63 68 | 20 69 73 20 61 20 70 65 |c, which| is a pe|
|000001e0| 72 6c 20 73 63 72 69 70 | 74 2c 20 49 20 67 65 74 |rl scrip|t, I get|
|000001f0| 0a 20 20 20 20 38 6b 20 | 6f 66 20 4e 55 4c 73 20 |. 8k |of NULs |
|00000200| 61 70 70 65 6e 64 65 64 | 20 74 6f 20 74 68 65 20 |appended| to the |
|00000210| 65 6e 64 20 6f 66 20 6d | 79 20 27 2e 6e 61 72 63 |end of m|y '.narc|
|00000220| 72 63 27 20 5b 77 68 69 | 63 68 20 4a 55 53 54 20 |rc' [whi|ch JUST |
|00000230| 53 4f 0a 20 20 20 20 48 | 41 50 50 45 4e 53 20 74 |SO. H|APPENS t|
|00000240| 6f 20 62 65 20 3d 3d 20 | 42 55 46 53 49 5a 5d 2e |o be == |BUFSIZ].|
|00000250| 2e 0a 0a 54 68 65 20 70 | 72 6f 67 72 61 6d 20 2d |...The p|rogram -|
|00000260| 0a 0a 20 20 20 20 54 6f | 20 68 65 6c 70 20 70 65 |.. To| help pe|
|00000270| 6f 70 6c 65 20 66 69 6e | 64 20 6d 79 20 70 72 6f |ople fin|d my pro|
|00000280| 62 6c 65 6d 20 3a 29 20 | 68 65 72 65 20 69 73 20 |blem :) |here is |
|00000290| 6d 79 20 6e 65 77 73 20 | 61 72 63 68 69 76 61 6c |my news |archival|
|000002a0| 0a 20 20 20 20 70 72 6f | 67 72 61 6d 2c 20 77 72 |. pro|gram, wr|
|000002b0| 69 74 74 65 6e 20 69 6e | 20 50 65 72 6c 2e 0a 0a |itten in| Perl...|
|000002c0| 23 21 2f 62 69 6e 2f 73 | 68 0a 23 20 54 68 69 73 |#!/bin/s|h.# This|
|000002d0| 20 69 73 20 61 20 73 68 | 65 6c 6c 20 61 72 63 68 | is a sh|ell arch|
|000002e0| 69 76 65 2c 20 6d 65 61 | 6e 69 6e 67 3a 0a 23 20 |ive, mea|ning:.# |
|000002f0| 31 2e 20 52 65 6d 6f 76 | 65 20 65 76 65 72 79 74 |1. Remov|e everyt|
|00000300| 68 69 6e 67 20 61 62 6f | 76 65 20 74 68 65 20 23 |hing abo|ve the #|
|00000310| 21 2f 62 69 6e 2f 73 68 | 20 6c 69 6e 65 2e 0a 23 |!/bin/sh| line..#|
|00000320| 20 32 2e 20 53 61 76 65 | 20 74 68 65 20 72 65 73 | 2. Save| the res|
|00000330| 75 6c 74 69 6e 67 20 74 | 65 78 74 20 69 6e 20 61 |ulting t|ext in a|
|00000340| 20 66 69 6c 65 2e 0a 23 | 20 33 2e 20 45 78 65 63 | file..#| 3. Exec|
|00000350| 75 74 65 20 74 68 65 20 | 66 69 6c 65 20 77 69 74 |ute the |file wit|
|00000360| 68 20 2f 62 69 6e 2f 73 | 68 20 28 6e 6f 74 20 63 |h /bin/s|h (not c|
|00000370| 73 68 29 20 74 6f 20 63 | 72 65 61 74 65 20 74 68 |sh) to c|reate th|
|00000380| 65 20 66 69 6c 65 73 3a | 0a 23 09 6e 61 72 63 2e |e files:|.#.narc.|
|00000390| 70 6c 0a 23 20 54 68 69 | 73 20 61 72 63 68 69 76 |pl.# Thi|s archiv|
|000003a0| 65 20 63 72 65 61 74 65 | 64 3a 20 4d 6f 6e 20 4d |e create|d: Mon M|
|000003b0| 61 72 20 32 36 20 31 35 | 3a 34 36 3a 34 34 20 31 |ar 26 15|:46:44 1|
|000003c0| 39 39 30 0a 23 20 42 79 | 3a 09 52 65 69 64 20 45 |990.# By|:.Reid E|
|000003d0| 6c 6c 69 73 20 28 41 6c | 69 61 73 20 52 65 73 65 |llis (Al|ias Rese|
|000003e0| 61 72 63 68 29 0a 65 78 | 70 6f 72 74 20 50 41 54 |arch).ex|port PAT|
|000003f0| 48 3b 20 50 41 54 48 3d | 2f 62 69 6e 3a 24 50 41 |H; PATH=|/bin:$PA|
|00000400| 54 48 0a 69 66 20 74 65 | 73 74 20 2d 66 20 27 6e |TH.if te|st -f 'n|
|00000410| 61 72 63 2e 70 6c 27 0a | 74 68 65 6e 0a 09 65 63 |arc.pl'.|then..ec|
|00000420| 68 6f 20 73 68 61 72 3a | 20 6f 76 65 72 2d 77 72 |ho shar:| over-wr|
|00000430| 69 74 69 6e 67 20 65 78 | 69 73 74 69 6e 67 20 66 |iting ex|isting f|
|00000440| 69 6c 65 20 22 27 6e 61 | 72 63 2e 70 6c 27 22 0a |ile "'na|rc.pl'".|
|00000450| 66 69 0a 63 61 74 20 3c | 3c 20 5c 53 48 41 52 5f |fi.cat <|< \SHAR_|
|00000460| 45 4f 46 20 3e 20 27 6e | 61 72 63 2e 70 6c 27 0a |EOF > 'n|arc.pl'.|
|00000470| 23 21 2f 75 73 72 2f 6c | 6f 63 61 6c 2f 62 69 6e |#!/usr/l|ocal/bin|
|00000480| 2f 70 65 72 6c 0a 23 0a | 23 20 24 53 6f 75 72 63 |/perl.#.|# $Sourc|
|00000490| 65 3a 20 2f 72 65 70 6f | 75 73 72 2f 75 2f 72 61 |e: /repo|usr/u/ra|
|000004a0| 65 2f 73 72 63 2f 54 45 | 58 54 2f 70 65 72 6c 2f |e/src/TE|XT/perl/|
|000004b0| 52 43 53 2f 6e 61 72 63 | 2e 70 6c 2c 76 20 24 0a |RCS/narc|.pl,v $.|
|000004c0| 23 20 24 52 65 76 69 73 | 69 6f 6e 3a 20 32 2e 30 |# $Revis|ion: 2.0|
|000004d0| 20 24 0a 23 20 24 41 75 | 74 68 6f 72 3a 20 72 61 | $.# $Au|thor: ra|
|000004e0| 65 20 24 0a 23 20 24 44 | 61 74 65 3a 20 39 30 2f |e $.# $D|ate: 90/|
|000004f0| 30 33 2f 32 35 20 31 35 | 3a 34 33 3a 30 30 20 24 |03/25 15|:43:00 $|
|00000500| 0a 0a 23 20 6e 61 72 63 | 20 2d 2d 20 4e 65 77 73 |..# narc| -- News|
|00000510| 20 41 52 43 68 69 76 65 | 72 0a 0a 23 20 74 6f 20 | ARChive|r..# to |
|00000520| 61 76 6f 69 64 20 74 68 | 65 20 62 75 66 66 65 72 |avoid th|e buffer|
|00000530| 69 6e 67 20 70 72 6f 62 | 6c 65 6d 73 0a 23 0a 24 |ing prob|lems.#.$|
|00000540| 7c 20 3d 20 30 3b 0a 0a | 23 20 43 68 65 63 6b 20 || = 0;..|# Check |
|00000550| 66 6f 72 20 61 20 4e 41 | 52 43 52 43 20 65 6e 76 |for a NA|RCRC env|
|00000560| 69 72 6f 6e 6d 65 6e 74 | 20 76 61 72 69 61 62 6c |ironment| variabl|
|00000570| 65 20 61 6e 64 20 75 73 | 65 20 69 74 20 69 66 0a |e and us|e it if.|
|00000580| 23 20 69 74 27 73 20 74 | 68 65 72 65 2e 0a 23 0a |# it's t|here..#.|
|00000590| 69 66 28 24 45 4e 56 7b | 27 4e 41 52 43 52 43 27 |if($ENV{|'NARCRC'|
|000005a0| 7d 29 0a 09 7b 0a 09 24 | 6e 61 72 63 72 63 20 3d |})..{..$|narcrc =|
|000005b0| 20 24 45 4e 56 7b 27 4e | 41 52 43 52 43 27 7d 3b | $ENV{'N|ARCRC'};|
|000005c0| 0a 0a 09 23 20 69 66 20 | 4e 41 52 43 52 43 20 64 |...# if |NARCRC d|
|000005d0| 6f 65 73 6e 27 74 20 73 | 74 61 72 74 20 77 69 74 |oesn't s|tart wit|
|000005e0| 68 20 61 20 27 2f 27 2c | 20 70 72 65 70 65 6e 64 |h a '/',| prepend|
|000005f0| 0a 09 23 20 24 48 4f 4d | 45 20 74 6f 20 69 74 0a |..# $HOM|E to it.|
|00000600| 09 23 0a 09 69 66 28 24 | 6e 61 72 63 72 63 20 21 |.#..if($|narcrc !|
|00000610| 7e 20 2f 5c 2f 2e 2a 2f | 29 0a 09 09 7b 0a 09 09 |~ /\/.*/|)...{...|
|00000620| 24 6e 61 72 63 72 63 20 | 3d 20 24 45 4e 56 7b 22 |$narcrc |= $ENV{"|
|00000630| 48 4f 4d 45 22 7d 20 2e | 20 22 2f 22 20 2e 20 24 |HOME"} .| "/" . $|
|00000640| 6e 61 72 63 72 63 3b 0a | 09 09 7d 0a 09 7d 0a 65 |narcrc;.|..}..}.e|
|00000650| 6c 73 65 0a 09 7b 0a 09 | 23 20 44 65 66 61 75 6c |lse..{..|# Defaul|
|00000660| 74 20 4e 41 52 43 52 43 | 3a 20 22 24 48 4f 4d 45 |t NARCRC|: "$HOME|
|00000670| 2f 2e 6e 61 72 63 72 63 | 22 0a 09 23 0a 09 24 6e |/.narcrc|"..#..$n|
|00000680| 61 72 63 72 63 20 3d 20 | 24 45 4e 56 7b 27 48 4f |arcrc = |$ENV{'HO|
|00000690| 4d 45 27 7d 20 2e 20 22 | 2f 2e 6e 61 72 63 72 63 |ME'} . "|/.narcrc|
|000006a0| 22 3b 0a 09 7d 0a 0a 23 | 20 74 65 73 74 69 6e 67 |";..}..#| testing|
|000006b0| 20 66 6c 61 67 2e 20 55 | 73 75 61 6c 6c 79 20 7a | flag. U|sually z|
|000006c0| 65 72 6f 2e 0a 23 0a 24 | 76 65 72 62 6f 73 65 3d |ero..#.$|verbose=|
|000006d0| 30 3b 0a 24 73 74 61 6e | 64 61 6c 6f 6e 65 20 3d |0;.$stan|dalone =|
|000006e0| 20 22 73 74 61 6e 64 22 | 3b 0a 0a 23 20 67 65 74 | "stand"|;..# get|
|000006f0| 20 74 68 65 20 6e 61 6d | 65 20 6f 66 20 74 68 65 | the nam|e of the|
|00000700| 20 6e 65 77 73 20 73 65 | 72 76 65 72 2e 20 20 43 | news se|rver. C|
|00000710| 61 6e 20 62 65 20 72 65 | 70 6c 61 63 65 64 20 77 |an be re|placed w|
|00000720| 69 74 68 0a 23 20 61 20 | 68 61 72 64 63 6f 64 65 |ith.# a |hardcode|
|00000730| 64 20 27 24 73 65 72 76 | 65 72 3d 6d 61 63 68 69 |d '$serv|er=machi|
|00000740| 6e 65 3b 27 20 69 66 20 | 79 6f 75 20 6c 69 6b 65 |ne;' if |you like|
|00000750| 0a 23 0a 24 73 65 72 76 | 65 72 5f 66 69 6c 65 20 |.#.$serv|er_file |
|00000760| 3d 20 22 2f 75 73 72 2f | 6c 6f 63 61 6c 2f 6c 69 |= "/usr/|local/li|
|00000770| 62 2f 6e 65 77 73 2f 73 | 65 72 76 65 72 22 3b 0a |b/news/s|erver";.|
|00000780| 24 73 65 72 76 65 72 20 | 3d 20 60 63 61 74 20 24 |$server |= `cat $|
|00000790| 73 65 72 76 65 72 5f 66 | 69 6c 65 60 20 7c 7c 20 |server_f|ile` || |
|000007a0| 64 69 65 20 22 43 61 6e | 27 74 20 6f 70 65 6e 20 |die "Can|'t open |
|000007b0| 24 73 65 72 76 65 72 5f | 66 69 6c 65 22 3b 0a 63 |$server_|file";.c|
|000007c0| 68 6f 70 20 24 73 65 72 | 76 65 72 3b 0a 0a 23 20 |hop $ser|ver;..# |
|000007d0| 57 68 65 72 65 20 74 6f | 20 66 69 6e 64 20 6e 6e |Where to| find nn|
|000007e0| 74 70 0a 23 0a 24 6e 6e | 74 70 20 3d 20 22 2f 75 |tp.#.$nn|tp = "/u|
|000007f0| 73 72 2f 6c 6f 63 61 6c | 2f 62 69 6e 2f 6e 6e 74 |sr/local|/bin/nnt|
|00000800| 70 20 24 73 65 72 76 65 | 72 22 3b 0a 0a 23 20 6f |p $serve|r";..# o|
|00000810| 70 65 6e 20 6e 61 72 63 | 72 63 20 66 6f 72 20 69 |pen narc|rc for i|
|00000820| 6e 70 75 74 2e 20 20 54 | 68 65 20 66 6f 72 6d 61 |nput. T|he forma|
|00000830| 74 20 69 73 3a 0a 23 0a | 23 09 2f 66 75 6c 6c 2f |t is:.#.|#./full/|
|00000840| 70 61 74 68 2f 74 6f 2f | 61 72 63 68 69 76 65 2f |path/to/|archive/|
|00000850| 64 69 72 65 63 74 6f 72 | 79 0a 23 09 64 69 72 6e |director|y.#.dirn|
|00000860| 61 6d 65 20 20 20 6e 65 | 77 73 67 72 6f 75 70 20 |ame ne|wsgroup |
|00000870| 20 20 6c 61 73 74 2d 74 | 69 6d 65 2d 6f 66 2d 61 | last-t|ime-of-a|
|00000880| 63 63 65 73 73 0a 23 09 | 64 69 72 6e 61 6d 65 20 |ccess.#.|dirname |
|00000890| 20 20 6e 65 77 73 67 72 | 6f 75 70 20 20 20 6c 61 | newsgr|oup la|
|000008a0| 73 74 2d 74 69 6d 65 2d | 6f 66 2d 61 63 63 65 73 |st-time-|of-acces|
|000008b0| 73 0a 23 09 64 69 72 6e | 61 6d 65 20 20 20 6e 65 |s.#.dirn|ame ne|
|000008c0| 77 73 67 72 6f 75 70 20 | 20 20 6c 61 73 74 2d 74 |wsgroup | last-t|
|000008d0| 69 6d 65 2d 6f 66 2d 61 | 63 63 65 73 73 0a 23 09 |ime-of-a|ccess.#.|
|000008e0| 20 2e 2e 2e 0a 23 0a 23 | 20 27 64 69 72 6e 61 6d | ....#.#| 'dirnam|
|000008f0| 65 27 20 69 73 20 61 70 | 70 65 6e 64 65 64 20 74 |e' is ap|pended t|
|00000900| 6f 20 74 68 65 20 69 6e | 69 74 69 61 6c 20 70 61 |o the in|itial pa|
|00000910| 74 68 2e 20 20 54 68 65 | 20 73 70 65 63 69 61 6c |th. The| special|
|00000920| 0a 23 20 63 61 73 65 20 | 64 69 72 6e 61 6d 65 20 |.# case |dirname |
|00000930| 6f 66 20 27 64 65 66 61 | 75 6c 74 27 20 77 69 6c |of 'defa|ult' wil|
|00000940| 6c 20 75 73 65 20 74 68 | 65 20 6c 61 73 74 20 65 |l use th|e last e|
|00000950| 6c 65 6d 65 6e 74 20 6f | 66 0a 23 20 74 68 65 20 |lement o|f.# the |
|00000960| 6e 65 77 73 67 72 6f 75 | 70 20 6e 61 6d 65 2e 20 |newsgrou|p name. |
|00000970| 20 46 6f 72 20 65 78 61 | 6d 70 6c 65 2c 20 0a 23 | For exa|mple, .#|
|00000980| 09 64 65 66 61 75 6c 74 | 20 20 63 6f 6d 70 2e 73 |.default| comp.s|
|00000990| 6f 75 72 63 65 73 2e 75 | 6e 69 78 20 20 31 39 39 |ources.u|nix 199|
|000009a0| 30 30 31 30 31 20 30 30 | 30 30 30 30 0a 23 20 77 |00101 00|0000.# w|
|000009b0| 69 6c 6c 20 75 73 65 20 | 74 68 65 20 64 69 72 6e |ill use |the dirn|
|000009c0| 61 6d 65 20 27 75 6e 69 | 78 27 0a 0a 6f 70 65 6e |ame 'uni|x'..open|
|000009d0| 28 4e 41 52 43 52 43 2c | 20 22 3c 24 6e 61 72 63 |(NARCRC,| "<$narc|
|000009e0| 72 63 22 29 3b 0a 24 53 | 49 47 7b 27 49 4e 54 27 |rc");.$S|IG{'INT'|
|000009f0| 7d 20 3d 20 27 68 61 6e | 64 6c 65 72 27 3b 0a 24 |} = 'han|dler';.$|
|00000a00| 53 49 47 7b 27 51 55 49 | 54 27 7d 20 3d 20 27 68 |SIG{'QUI|T'} = 'h|
|00000a10| 61 6e 64 6c 65 72 27 3b | 0a 0a 23 20 54 68 65 20 |andler';|..# The |
|00000a20| 66 69 72 73 74 20 6c 69 | 6e 65 20 6f 66 20 74 68 |first li|ne of th|
|00000a30| 65 20 6e 61 72 63 72 63 | 20 69 73 20 77 68 65 72 |e narcrc| is wher|
|00000a40| 65 20 74 6f 20 73 74 6f | 72 65 20 65 76 65 72 79 |e to sto|re every|
|00000a50| 74 68 69 67 6e 0a 23 0a | 24 72 65 70 6f 20 3d 20 |thign.#.|$repo = |
|00000a60| 3c 4e 41 52 43 52 43 3e | 3b 0a 63 68 6f 70 28 24 |<NARCRC>|;.chop($|
|00000a70| 72 65 70 6f 29 3b 0a 70 | 72 69 6e 74 20 22 53 61 |repo);.p|rint "Sa|
|00000a80| 76 69 6e 67 20 66 69 6c | 65 73 20 69 6e 20 24 72 |ving fil|es in $r|
|00000a90| 65 70 6f 5c 6e 22 20 69 | 66 20 24 76 65 72 62 6f |epo\n" i|f $verbo|
|00000aa0| 73 65 3b 0a 0a 23 20 24 | 6e 61 72 63 5f 6c 69 6e |se;..# $|narc_lin|
|00000ab0| 65 5b 24 6e 61 72 63 5f | 69 6e 64 65 78 5d 20 69 |e[$narc_|index] i|
|00000ac0| 73 20 77 68 65 72 65 20 | 65 61 63 68 20 6e 65 77 |s where |each new|
|00000ad0| 20 6c 69 6e 65 20 6f 66 | 20 74 68 65 20 6e 61 72 | line of| the nar|
|00000ae0| 63 72 63 20 69 73 0a 23 | 20 73 74 6f 72 65 64 20 |crc is.#| stored |
|00000af0| 2e 20 20 54 68 69 73 20 | 6f 6e 6c 79 20 67 65 74 |. This |only get|
|00000b00| 73 20 77 72 69 74 74 65 | 6e 20 6f 75 74 20 61 66 |s writte|n out af|
|00000b10| 74 65 72 20 61 20 73 75 | 63 63 65 73 73 66 75 6c |ter a su|ccessful|
|00000b20| 20 27 6e 61 72 63 27 2e | 0a 23 0a 24 6e 61 72 63 | 'narc'.|.#.$narc|
|00000b30| 5f 69 6e 64 65 78 20 3d | 20 31 3b 0a 0a 23 20 66 |_index =| 1;..# f|
|00000b40| 6f 72 20 65 61 63 68 20 | 6c 69 6e 65 20 69 6e 20 |or each |line in |
|00000b50| 74 68 65 20 6e 61 72 63 | 72 63 0a 23 09 63 68 6f |the narc|rc.#.cho|
|00000b60| 70 20 69 74 20 69 6e 74 | 6f 20 73 65 70 61 72 61 |p it int|o separa|
|00000b70| 74 65 20 62 69 74 73 0a | 23 09 61 73 6b 20 6e 6e |te bits.|#.ask nn|
|00000b80| 74 70 20 66 6f 72 20 61 | 6c 6c 20 6e 65 77 20 6e |tp for a|ll new n|
|00000b90| 65 77 73 20 66 6f 72 20 | 74 68 65 20 67 72 6f 75 |ews for |the grou|
|00000ba0| 70 0a 23 09 66 6f 72 20 | 65 61 63 68 20 6e 65 77 |p.#.for |each new|
|00000bb0| 20 6e 65 77 73 20 69 74 | 65 6d 0a 23 09 09 72 65 | news it|em.#..re|
|00000bc0| 61 64 20 61 72 74 69 63 | 6c 65 20 69 6e 74 6f 20 |ad artic|le into |
|00000bd0| 2f 74 6d 70 2f 6e 61 72 | 63 24 24 0a 23 09 09 73 |/tmp/nar|c$$.#..s|
|00000be0| 63 61 6e 20 66 6f 72 20 | 6d 61 67 69 63 20 73 74 |can for |magic st|
|00000bf0| 72 69 6e 67 20 27 41 72 | 63 68 69 76 65 2d 6e 61 |ring 'Ar|chive-na|
|00000c00| 6d 65 27 0a 23 09 09 67 | 65 74 20 74 68 65 20 73 |me'.#..g|et the s|
|00000c10| 75 62 64 69 72 20 61 6e | 64 20 70 61 72 74 2d 6e |ubdir an|d part-n|
|00000c20| 61 6d 65 20 66 72 6f 6d | 20 74 68 69 73 20 6c 69 |ame from| this li|
|00000c30| 6e 65 0a 23 09 69 66 20 | 68 69 74 20 65 6f 66 2c |ne.#.if |hit eof,|
|00000c40| 20 74 68 65 6e 20 6e 6f | 20 6d 61 67 69 63 20 73 | then no| magic s|
|00000c50| 74 72 69 6e 67 20 77 61 | 73 20 66 6f 75 6e 64 2c |tring wa|s found,|
|00000c60| 20 64 6f 20 6e 65 78 74 | 20 6e 65 77 73 20 69 74 | do next| news it|
|00000c70| 65 6d 0a 23 09 63 72 65 | 61 74 65 20 61 6c 6c 20 |em.#.cre|ate all |
|00000c80| 6c 65 61 64 69 6e 67 20 | 64 69 72 65 63 74 6f 72 |leading |director|
|00000c90| 69 65 73 20 69 66 20 74 | 68 65 79 27 72 65 20 6e |ies if t|hey're n|
|00000ca0| 6f 74 20 74 68 65 72 65 | 20 61 6c 72 65 61 64 79 |ot there| already|
|00000cb0| 0a 23 09 6d 6f 76 65 20 | 2f 74 6d 70 2f 6e 61 72 |.#.move |/tmp/nar|
|00000cc0| 63 24 24 20 74 6f 20 66 | 75 6c 6c 20 70 61 74 68 |c$$ to f|ull path|
|00000cd0| 6e 61 6d 65 20 6f 66 20 | 61 72 63 68 69 76 65 64 |name of |archived|
|00000ce0| 20 61 72 74 69 63 6c 65 | 0a 77 68 69 6c 65 28 24 | article|.while($|
|00000cf0| 6e 61 72 63 5f 65 6e 74 | 72 79 20 3d 20 3c 4e 41 |narc_ent|ry = <NA|
|00000d00| 52 43 52 43 3e 29 0a 09 | 7b 0a 09 63 68 6f 70 28 |RCRC>)..|{..chop(|
|00000d10| 24 6e 61 72 63 5f 65 6e | 74 72 79 29 3b 0a 0a 09 |$narc_en|try);...|
|00000d20| 23 20 54 68 69 73 20 69 | 73 20 61 20 73 6f 66 74 |# This i|s a soft|
|00000d30| 77 61 72 65 20 65 6e 64 | 2d 6f 66 2d 66 69 6c 65 |ware end|-of-file|
|00000d40| 20 62 65 63 61 75 73 65 | 20 49 20 61 6d 20 68 61 | because| I am ha|
|00000d50| 76 69 6e 67 20 74 72 6f | 75 62 6c 65 20 77 69 74 |ving tro|uble wit|
|00000d60| 68 0a 09 23 20 67 61 72 | 62 61 67 65 20 73 68 6f |h..# gar|bage sho|
|00000d70| 77 69 6e 67 20 75 70 20 | 61 74 20 74 68 65 20 65 |wing up |at the e|
|00000d80| 6e 64 73 20 6f 66 20 66 | 69 6c 65 2e 20 20 57 69 |nds of f|ile. Wi|
|00000d90| 74 68 20 73 68 61 72 20 | 66 69 6c 65 73 20 69 74 |th shar |files it|
|00000da0| 27 73 0a 09 23 20 6e 6f | 74 20 73 75 63 68 20 61 |'s..# no|t such a|
|00000db0| 20 62 69 67 20 64 65 61 | 6c 2c 20 73 69 6e 63 65 | big dea|l, since|
|00000dc0| 20 74 68 65 79 20 75 73 | 75 61 6c 6c 79 20 68 61 | they us|ually ha|
|00000dd0| 76 65 20 27 65 78 69 74 | 20 30 27 20 61 74 20 74 |ve 'exit| 0' at t|
|00000de0| 68 65 20 65 6e 64 0a 09 | 23 20 6f 66 20 74 68 65 |he end..|# of the|
|00000df0| 6d 2c 20 62 75 74 20 77 | 69 74 68 20 74 68 65 20 |m, but w|ith the |
|00000e00| 2e 6e 61 72 63 72 63 2c | 20 69 74 20 6d 69 67 68 |.narcrc,| it migh|
|00000e10| 74 20 62 65 20 61 63 63 | 69 64 65 6e 74 61 6c 6c |t be acc|identall|
|00000e20| 79 20 70 61 72 73 65 64 | 2e 0a 09 23 0a 09 6c 61 |y parsed|...#..la|
|00000e30| 73 74 20 69 66 28 24 6e | 61 72 63 5f 65 6e 74 72 |st if($n|arc_entr|
|00000e40| 79 20 65 71 20 22 45 4f | 46 22 29 3b 0a 0a 09 28 |y eq "EO|F");...(|
|00000e50| 24 72 65 61 6c 5f 64 69 | 72 6e 61 6d 65 2c 20 24 |$real_di|rname, $|
|00000e60| 6e 65 77 73 67 72 6f 75 | 70 2c 20 24 6c 61 73 74 |newsgrou|p, $last|
|00000e70| 64 61 74 65 2c 20 24 6c | 61 73 74 74 69 6d 65 29 |date, $l|asttime)|
|00000e80| 20 3d 20 73 70 6c 69 74 | 28 27 20 27 2c 20 24 6e | = split|(' ', $n|
|00000e90| 61 72 63 5f 65 6e 74 72 | 79 29 3b 0a 0a 09 23 20 |arc_entr|y);...# |
|00000ea0| 63 68 65 63 6b 20 66 6f | 72 20 64 65 67 65 6e 65 |check fo|r degene|
|00000eb0| 72 61 74 65 20 65 6d 70 | 74 79 20 63 61 73 65 0a |rate emp|ty case.|
|00000ec0| 09 23 09 0a 09 6c 61 73 | 74 20 69 66 20 24 6e 65 |.#...las|t if $ne|
|00000ed0| 77 73 67 72 6f 75 70 20 | 65 71 20 22 22 20 7c 7c |wsgroup |eq "" |||
|00000ee0| 20 24 6c 61 73 74 64 61 | 74 65 20 65 71 20 22 22 | $lastda|te eq ""|
|00000ef0| 20 7c 7c 20 24 6c 61 73 | 74 74 69 6d 65 20 65 71 | || $las|ttime eq|
|00000f00| 20 22 22 3b 0a 0a 09 23 | 20 69 66 20 22 64 65 66 | "";...#| if "def|
|00000f10| 61 75 6c 74 22 2c 20 73 | 65 74 20 64 69 72 6e 61 |ault", s|et dirna|
|00000f20| 6d 65 20 74 6f 20 6c 61 | 73 74 20 65 6c 65 6d 65 |me to la|st eleme|
|00000f30| 6e 74 0a 09 23 20 6f 66 | 20 74 68 65 20 6e 65 77 |nt..# of| the new|
|00000f40| 73 67 72 6f 75 70 20 6e | 61 6d 65 0a 09 23 0a 09 |sgroup n|ame..#..|
|00000f50| 69 66 28 24 72 65 61 6c | 5f 64 69 72 6e 61 6d 65 |if($real|_dirname|
|00000f60| 20 65 71 20 22 64 65 66 | 61 75 6c 74 22 20 26 26 | eq "def|ault" &&|
|00000f70| 20 24 6e 65 77 73 67 72 | 6f 75 70 20 3d 7e 20 2f | $newsgr|oup =~ /|
|00000f80| 2e 2a 5c 2e 28 5b 5e 2e | 5d 2a 29 24 2f 29 0a 09 |.*\.([^.|]*)$/)..|
|00000f90| 09 7b 0a 09 09 24 64 69 | 72 6e 61 6d 65 20 3d 20 |.{...$di|rname = |
|00000fa0| 24 31 3b 0a 09 09 7d 0a | 09 65 6c 73 65 0a 09 09 |$1;...}.|.else...|
|00000fb0| 7b 0a 09 09 24 64 69 72 | 6e 61 6d 65 20 3d 20 24 |{...$dir|name = $|
|00000fc0| 72 65 61 6c 5f 64 69 72 | 6e 61 6d 65 3b 0a 09 09 |real_dir|name;...|
|00000fd0| 7d 0a 0a 09 23 20 74 65 | 6c 6c 20 74 68 65 20 75 |}...# te|ll the u|
|00000fe0| 73 65 72 20 77 68 61 74 | 27 73 20 67 6f 69 6e 67 |ser what|'s going|
|00000ff0| 20 6f 6e 0a 09 23 0a 09 | 22 24 6c 61 73 74 64 61 | on..#..|"$lastda|
|00001000| 74 65 20 24 6c 61 73 74 | 74 69 6d 65 22 20 3d 7e |te $last|time" =~|
|00001010| 20 2f 5e 28 2e 2e 29 28 | 2e 2e 29 28 2e 2e 29 20 | /^(..)(|..)(..) |
|00001020| 28 2e 2e 29 28 2e 2e 29 | 28 2e 2e 29 24 2f 20 26 |(..)(..)|(..)$/ &|
|00001030| 26 0a 09 09 70 72 69 6e | 74 66 28 22 25 73 20 25 |&...prin|tf("%s %|
|00001040| 73 20 31 39 25 73 2d 25 | 73 2d 25 73 20 25 73 3a |s 19%s-%|s-%s %s:|
|00001050| 25 73 5c 6e 22 2c 0a 09 | 09 09 24 6e 65 77 73 67 |%s\n",..|..$newsg|
|00001060| 72 6f 75 70 2c 20 22 5b | 24 64 69 72 6e 61 6d 65 |roup, "[|$dirname|
|00001070| 5d 22 2c 20 24 31 2c 20 | 24 32 2c 20 24 33 2c 20 |]", $1, |$2, $3, |
|00001080| 24 34 2c 20 24 35 29 3b | 0a 0a 09 23 20 6f 70 65 |$4, $5);|...# ope|
|00001090| 6e 20 74 68 65 20 73 74 | 64 6f 75 74 20 6f 66 20 |n the st|dout of |
|000010a0| 74 68 65 20 6e 6e 74 70 | 20 63 6f 6d 6d 61 6e 64 |the nntp| command|
|000010b0| 0a 09 23 0a 09 6f 70 65 | 6e 28 4d 53 47 49 44 53 |..#..ope|n(MSGIDS|
|000010c0| 2c 20 22 24 6e 6e 74 70 | 20 6e 65 77 6e 65 77 73 |, "$nntp| newnews|
|000010d0| 20 24 6e 65 77 73 67 72 | 6f 75 70 20 24 6c 61 73 | $newsgr|oup $las|
|000010e0| 74 64 61 74 65 20 24 6c | 61 73 74 74 69 6d 65 7c |tdate $l|asttime||
|000010f0| 22 29 0a 09 09 7c 7c 20 | 64 69 65 20 22 43 61 6e |")...|| |die "Can|
|00001100| 27 74 20 67 65 74 20 6d | 65 73 73 61 67 65 20 49 |'t get m|essage I|
|00001110| 44 27 73 20 66 6f 72 20 | 24 6e 65 77 73 67 72 6f |D's for |$newsgro|
|00001120| 75 70 20 66 72 6f 6d 20 | 24 73 65 72 76 65 72 22 |up from |$server"|
|00001130| 3b 0a 0a 09 23 20 66 6c | 61 67 20 74 6f 20 73 65 |;...# fl|ag to se|
|00001140| 65 20 69 66 20 77 65 20 | 64 6f 20 61 6e 79 74 68 |e if we |do anyth|
|00001150| 69 6e 67 0a 09 24 77 65 | 5f 64 69 64 5f 73 6f 6d |ing..$we|_did_som|
|00001160| 65 74 68 69 6e 67 20 3d | 20 30 3b 0a 0a 09 23 20 |ething =| 0;...# |
|00001170| 66 6f 72 20 65 61 63 68 | 20 6d 65 73 73 61 67 65 |for each| message|
|00001180| 20 49 44 2e 2e 0a 09 23 | 0a 09 77 68 69 6c 65 28 | ID....#|..while(|
|00001190| 24 6d 73 67 69 64 20 3d | 20 3c 4d 53 47 49 44 53 |$msgid =| <MSGIDS|
|000011a0| 3e 29 0a 09 09 7b 0a 09 | 09 23 20 73 65 74 20 74 |>)...{..|.# set t|
|000011b0| 68 65 20 77 65 5f 64 69 | 64 5f 73 6f 6d 65 74 68 |he we_di|d_someth|
|000011c0| 69 6e 67 20 66 6c 61 67 | 20 73 6f 20 77 65 20 6b |ing flag| so we k|
|000011d0| 6e 6f 77 20 74 6f 20 75 | 70 64 61 74 65 0a 09 09 |now to u|pdate...|
|000011e0| 23 20 74 68 65 20 6e 61 | 72 63 72 63 0a 09 09 23 |# the na|rcrc...#|
|000011f0| 0a 09 09 24 77 65 5f 64 | 69 64 5f 73 6f 6d 65 74 |...$we_d|id_somet|
|00001200| 68 69 6e 67 20 3d 20 31 | 3b 0a 0a 09 09 23 20 5a |hing = 1|;....# Z|
|00001210| 61 70 20 74 68 65 20 74 | 72 61 69 6c 69 6e 67 20 |ap the t|railing |
|00001220| 6e 65 77 6c 69 6e 65 20 | 6f 6e 20 24 6d 73 67 69 |newline |on $msgi|
|00001230| 64 0a 09 09 23 0a 09 09 | 63 68 6f 70 28 24 6d 73 |d...#...|chop($ms|
|00001240| 67 69 64 29 3b 0a 09 09 | 70 72 69 6e 74 20 22 5c |gid);...|print "\|
|00001250| 74 24 6d 73 67 69 64 5c | 6e 22 20 69 66 20 24 76 |t$msgid\|n" if $v|
|00001260| 65 72 62 6f 73 65 3b 0a | 0a 09 09 23 20 47 65 74 |erbose;.|...# Get|
|00001270| 20 74 68 65 20 61 72 74 | 69 63 6c 65 20 61 6e 64 | the art|icle and|
|00001280| 20 73 74 6f 72 65 20 69 | 74 20 69 6e 20 2f 74 6d | store i|t in /tm|
|00001290| 70 20 73 6f 20 77 65 20 | 64 6f 6e 27 74 0a 09 09 |p so we |don't...|
|000012a0| 23 20 6e 65 65 64 20 74 | 6f 20 75 73 65 20 6d 75 |# need t|o use mu|
|000012b0| 6c 74 69 70 6c 65 20 5b | 73 6c 6f 77 5d 20 6e 6e |ltiple [|slow] nn|
|000012c0| 74 70 27 73 20 66 6f 72 | 20 74 68 65 20 73 61 6d |tp's for| the sam|
|000012d0| 65 20 61 72 74 69 63 6c | 65 0a 09 09 23 0a 09 09 |e articl|e...#...|
|000012e0| 73 79 73 74 65 6d 28 22 | 24 6e 6e 74 70 20 61 72 |system("|$nntp ar|
|000012f0| 74 69 63 6c 65 20 27 24 | 6d 73 67 69 64 27 20 3e |ticle '$|msgid' >|
|00001300| 20 2f 74 6d 70 2f 6e 61 | 72 63 24 24 22 29 3b 0a | /tmp/na|rc$$");.|
|00001310| 0a 09 09 23 20 4f 70 65 | 6e 20 74 68 65 20 61 72 |...# Ope|n the ar|
|00001320| 74 69 63 6c 65 20 61 6e | 64 20 63 68 65 63 6b 20 |ticle an|d check |
|00001330| 66 6f 72 20 22 41 72 63 | 68 69 76 65 2d 6e 61 6d |for "Arc|hive-nam|
|00001340| 65 22 0a 09 09 23 0a 20 | 09 09 6f 70 65 6e 28 42 |e"...#. |..open(B|
|00001350| 4f 44 59 2c 20 22 3c 2f | 74 6d 70 2f 6e 61 72 63 |ODY, "</|tmp/narc|
|00001360| 24 24 22 29 20 7c 7c 20 | 64 69 65 20 22 43 61 6e |$$") || |die "Can|
|00001370| 27 74 20 72 65 61 64 20 | 72 65 74 72 69 65 76 65 |'t read |retrieve|
|00001380| 64 20 61 72 74 69 63 6c | 65 20 24 6d 73 67 69 64 |d articl|e $msgid|
|00001390| 20 69 6e 20 66 69 6c 65 | 20 2f 74 6d 70 2f 6e 61 | in file| /tmp/na|
|000013a0| 72 63 24 24 22 3b 0a 09 | 09 77 68 69 6c 65 28 3c |rc$$";..|.while(<|
|000013b0| 42 4f 44 59 3e 29 0a 09 | 09 09 7b 0a 09 09 09 69 |BODY>)..|..{....i|
|000013c0| 66 28 2f 5e 41 72 63 68 | 69 76 65 2d 6e 61 6d 65 |f(/^Arch|ive-name|
|000013d0| 3a 2f 29 0a 09 09 09 09 | 7b 0a 09 09 09 09 28 24 |:/).....|{.....($|
|000013e0| 66 6f 6f 2c 20 24 61 72 | 63 5f 6e 61 6d 65 29 20 |foo, $ar|c_name) |
|000013f0| 3d 20 73 70 6c 69 74 3b | 0a 09 09 09 09 40 74 72 |= split;|.....@tr|
|00001400| 65 65 20 3d 20 73 70 6c | 69 74 28 27 2f 27 2c 20 |ee = spl|it('/', |
|00001410| 24 61 72 63 5f 6e 61 6d | 65 29 3b 0a 09 09 09 09 |$arc_nam|e);.....|
|00001420| 23 20 50 75 74 20 69 74 | 20 69 6e 20 74 68 65 20 |# Put it| in the |
|00001430| 27 24 73 74 61 6e 64 61 | 6c 6f 6e 65 27 20 64 69 |'$standa|lone' di|
|00001440| 72 20 69 66 20 69 74 27 | 73 20 61 20 73 69 6e 67 |r if it'|s a sing|
|00001450| 6c 65 20 73 68 61 72 0a | 09 09 09 09 75 6e 73 68 |le shar.|....unsh|
|00001460| 69 66 74 28 74 72 65 65 | 2c 20 24 73 74 61 6e 64 |ift(tree|, $stand|
|00001470| 61 6c 6f 6e 65 29 09 69 | 66 20 24 23 74 72 65 65 |alone).i|f $#tree|
|00001480| 20 3d 3d 20 30 3b 0a 09 | 09 09 09 70 72 69 6e 74 | == 0;..|...print|
|00001490| 20 22 5c 74 22 2c 20 6a | 6f 69 6e 28 27 2f 27 2c | "\t", j|oin('/',|
|000014a0| 20 40 74 72 65 65 29 2c | 20 22 5c 6e 22 3b 0a 09 | @tree),| "\n";..|
|000014b0| 09 09 09 6c 61 73 74 3b | 0a 09 09 09 09 7d 20 23 |...last;|.....} #|
|000014c0| 69 66 20 41 72 63 68 69 | 76 65 2d 6e 61 6d 65 0a |if Archi|ve-name.|
|000014d0| 09 09 09 7d 20 23 20 77 | 68 69 6c 65 20 42 4f 44 |...} # w|hile BOD|
|000014e0| 59 0a 0a 09 09 23 20 69 | 66 20 65 6f 66 20 74 68 |Y....# i|f eof th|
|000014f0| 65 6e 20 22 41 72 63 68 | 69 76 65 2d 6e 61 6d 65 |en "Arch|ive-name|
|00001500| 22 20 77 61 73 6e 27 74 | 20 66 6f 75 6e 64 0a 09 |" wasn't| found..|
|00001510| 09 23 0a 09 09 6c 61 73 | 74 20 69 66 20 65 6f 66 |.#...las|t if eof|
|00001520| 3b 0a 0a 09 09 23 20 63 | 6c 6f 73 65 20 74 68 65 |;....# c|lose the|
|00001530| 20 66 69 6c 65 0a 09 09 | 23 0a 09 09 63 6c 6f 73 | file...|#...clos|
|00001540| 65 28 3c 42 4f 44 59 3e | 29 3b 0a 0a 09 09 23 20 |e(<BODY>|);....# |
|00001550| 4e 6f 77 20 62 75 69 6c | 64 20 74 68 65 20 66 75 |Now buil|d the fu|
|00001560| 6c 6c 20 70 61 74 68 6e | 61 6d 65 20 6f 66 20 77 |ll pathn|ame of w|
|00001570| 68 65 72 65 20 74 68 65 | 20 66 69 6c 65 20 69 73 |here the| file is|
|00001580| 0a 09 09 23 20 73 75 70 | 70 6f 73 65 64 20 74 6f |...# sup|posed to|
|00001590| 20 6c 69 76 65 0a 09 09 | 24 66 75 6c 6c 70 61 74 | live...|$fullpat|
|000015a0| 68 20 3d 20 24 72 65 70 | 6f 20 2e 20 27 2f 27 20 |h = $rep|o . '/' |
|000015b0| 2e 20 24 64 69 72 6e 61 | 6d 65 20 2e 20 27 2f 27 |. $dirna|me . '/'|
|000015c0| 20 2e 20 6a 6f 69 6e 28 | 27 2f 27 2c 20 40 74 72 | . join(|'/', @tr|
|000015d0| 65 65 29 3b 0a 09 09 24 | 6e 61 6d 65 20 3d 20 70 |ee);...$|name = p|
|000015e0| 6f 70 28 40 74 72 65 65 | 29 3b 0a 09 09 24 72 65 |op(@tree|);...$re|
|000015f0| 6c 70 61 74 68 20 3d 20 | 24 64 69 72 6e 61 6d 65 |lpath = |$dirname|
|00001600| 20 2e 20 27 2f 27 20 2e | 20 6a 6f 69 6e 28 27 2f | . '/' .| join('/|
|00001610| 27 2c 20 40 74 72 65 65 | 29 3b 0a 0a 09 09 23 20 |', @tree|);....# |
|00001620| 6d 61 6b 65 20 73 75 72 | 65 20 74 68 65 20 64 69 |make sur|e the di|
|00001630| 72 73 20 61 72 65 20 74 | 68 65 72 65 0a 09 09 23 |rs are t|here...#|
|00001640| 0a 09 09 26 6d 6b 70 61 | 74 68 28 24 72 65 70 6f |...&mkpa|th($repo|
|00001650| 20 2e 20 27 2f 27 20 2e | 20 24 64 69 72 6e 61 6d | . '/' .| $dirnam|
|00001660| 65 20 2e 20 27 2f 27 20 | 2e 20 6a 6f 69 6e 28 27 |e . '/' |. join('|
|00001670| 2f 27 2c 20 40 74 72 65 | 65 29 29 3b 0a 0a 09 09 |/', @tre|e));....|
|00001680| 69 66 28 2d 66 20 24 66 | 75 6c 6c 70 61 74 68 29 |if(-f $f|ullpath)|
|00001690| 0a 09 09 09 7b 0a 09 09 | 09 23 20 41 20 63 6f 70 |....{...|.# A cop|
|000016a0| 79 20 6f 66 20 74 68 65 | 20 66 69 6c 65 20 61 6c |y of the| file al|
|000016b0| 72 65 61 64 79 20 65 78 | 69 73 74 73 2c 20 73 6f |ready ex|ists, so|
|000016c0| 20 6e 61 6d 65 20 74 68 | 69 73 20 6f 6e 65 20 74 | name th|is one t|
|000016d0| 68 65 0a 09 09 09 23 20 | 73 61 6d 65 20 61 73 20 |he....# |same as |
|000016e0| 74 68 65 20 65 78 69 73 | 74 69 6e 67 20 6f 6e 65 |the exis|ting one|
|000016f0| 2c 20 62 75 74 20 77 69 | 74 68 20 61 20 6e 75 6d |, but wi|th a num|
|00001700| 62 65 72 20 61 70 70 65 | 6e 64 65 64 20 74 6f 0a |ber appe|nded to.|
|00001710| 09 09 09 23 20 69 74 20 | 74 6f 20 64 65 6c 69 6e |...# it |to delin|
|00001720| 65 61 74 65 20 69 74 73 | 20 76 65 72 73 69 6f 6e |eate its| version|
|00001730| 2e 0a 09 09 09 23 0a 09 | 09 09 66 6f 72 28 24 69 |.....#..|..for($i|
|00001740| 3d 32 3b 20 2d 66 20 24 | 66 75 6c 6c 70 61 74 68 |=2; -f $|fullpath|
|00001750| 20 2e 20 24 69 3b 20 24 | 69 2b 2b 29 0a 09 09 09 | . $i; $|i++)....|
|00001760| 09 7b 20 7d 0a 0a 09 09 | 09 23 20 74 61 63 6b 20 |.{ }....|.# tack |
|00001770| 74 68 65 20 6e 75 6d 62 | 65 72 20 6f 6e 74 6f 20 |the numb|er onto |
|00001780| 74 68 65 20 65 6e 64 20 | 6f 66 20 74 68 65 20 66 |the end |of the f|
|00001790| 69 6c 65 20 6e 61 6d 65 | 0a 09 09 09 23 0a 09 09 |ile name|....#...|
|000017a0| 09 24 66 75 6c 6c 70 61 | 74 68 20 2e 3d 20 24 69 |.$fullpa|th .= $i|
|000017b0| 3b 0a 09 09 09 7d 0a 0a | 09 09 23 20 61 6e 64 20 |;....}..|..# and |
|000017c0| 66 69 6e 61 6c 6c 79 2c | 20 70 75 74 20 69 74 20 |finally,| put it |
|000017d0| 74 68 65 72 65 0a 09 09 | 73 79 73 74 65 6d 28 22 |there...|system("|
|000017e0| 6d 76 20 2f 74 6d 70 2f | 6e 61 72 63 24 24 20 24 |mv /tmp/|narc$$ $|
|000017f0| 66 75 6c 6c 70 61 74 68 | 22 29 3b 0a 0a 09 09 7d |fullpath|");....}|
|00001800| 20 23 20 77 68 69 6c 65 | 20 4d 53 47 49 44 53 0a | # while| MSGIDS.|
|00001810| 09 63 6c 6f 73 65 28 3c | 4d 53 47 49 44 53 3e 29 |.close(<|MSGIDS>)|
|00001820| 3b 0a 0a 09 23 20 6f 6e | 6c 79 20 75 70 64 61 74 |;...# on|ly updat|
|00001830| 65 20 74 68 65 20 74 69 | 6d 65 73 74 61 6d 70 20 |e the ti|mestamp |
|00001840| 69 66 20 77 65 20 64 69 | 64 20 61 6e 79 74 68 69 |if we di|d anythi|
|00001850| 6e 67 0a 09 23 0a 09 24 | 74 69 6d 65 73 74 61 6d |ng..#..$|timestam|
|00001860| 70 20 3d 20 24 77 65 5f | 64 69 64 5f 73 6f 6d 65 |p = $we_|did_some|
|00001870| 74 68 69 6e 67 20 3f 20 | 26 6e 6f 77 28 29 20 3a |thing ? |&now() :|
|00001880| 20 22 24 6c 61 73 74 64 | 61 74 65 20 24 6c 61 73 | "$lastd|ate $las|
|00001890| 74 74 69 6d 65 22 3b 0a | 0a 09 23 20 53 61 76 65 |ttime";.|..# Save|
|000018a0| 20 74 68 65 20 6e 61 72 | 63 72 63 20 6c 69 6e 65 | the nar|crc line|
|000018b0| 73 20 69 6e 20 6d 65 6d | 6f 72 79 20 69 6e 20 6f |s in mem|ory in o|
|000018c0| 72 64 65 72 20 73 6f 20 | 77 65 20 63 61 6e 20 73 |rder so |we can s|
|000018d0| 61 76 65 20 74 68 65 6d | 20 69 6e 0a 09 23 20 74 |ave them| in..# t|
|000018e0| 68 65 69 72 20 6f 72 69 | 67 69 6e 61 6c 20 6f 72 |heir ori|ginal or|
|000018f0| 64 65 72 2e 20 20 4a 75 | 73 74 20 75 73 69 6e 67 |der. Ju|st using|
|00001900| 20 27 65 61 63 68 27 20 | 6f 6e 20 25 4e 41 52 43 | 'each' |on %NARC|
|00001910| 52 43 20 63 75 72 72 65 | 6e 74 6c 79 0a 09 23 20 |RC curre|ntly..# |
|00001920| 69 6e 76 65 72 74 73 20 | 74 68 65 69 72 20 6f 72 |inverts |their or|
|00001930| 64 65 72 20 5b 61 73 20 | 6f 66 20 50 65 72 6c 20 |der [as |of Perl |
|00001940| 33 2e 30 5d 0a 09 23 0a | 09 24 6e 61 72 63 5f 6c |3.0]..#.|.$narc_l|
|00001950| 69 6e 65 5b 24 6e 61 72 | 63 5f 69 6e 64 65 78 2b |ine[$nar|c_index+|
|00001960| 2b 5d 20 3d 20 73 70 72 | 69 6e 74 66 28 22 25 73 |+] = spr|intf("%s|
|00001970| 5c 74 25 73 5c 74 25 73 | 22 2c 20 24 72 65 61 6c |\t%s\t%s|", $real|
|00001980| 5f 64 69 72 6e 61 6d 65 | 2c 20 24 6e 65 77 73 67 |_dirname|, $newsg|
|00001990| 72 6f 75 70 2c 20 24 74 | 69 6d 65 73 74 61 6d 70 |roup, $t|imestamp|
|000019a0| 29 3b 0a 09 7d 20 23 20 | 77 68 69 6c 65 20 6e 61 |);..} # |while na|
|000019b0| 72 63 5f 65 6e 74 72 79 | 0a 63 6c 6f 73 65 28 3c |rc_entry|.close(<|
|000019c0| 4e 41 52 43 52 43 3e 29 | 3b 0a 0a 23 20 53 61 76 |NARCRC>)|;..# Sav|
|000019d0| 65 20 61 6e 20 75 70 64 | 61 74 65 64 20 6e 61 72 |e an upd|ated nar|
|000019e0| 63 72 63 0a 23 0a 70 72 | 69 6e 74 20 22 53 61 76 |crc.#.pr|int "Sav|
|000019f0| 69 6e 67 20 24 6e 61 72 | 63 72 63 2e 2e 22 3b 0a |ing $nar|crc..";.|
|00001a00| 6f 70 65 6e 28 4e 41 52 | 43 52 43 2c 20 22 3e 24 |open(NAR|CRC, ">$|
|00001a10| 6e 61 72 63 72 63 22 29 | 3b 0a 70 72 69 6e 74 20 |narcrc")|;.print |
|00001a20| 4e 41 52 43 52 43 20 24 | 72 65 70 6f 2c 20 22 5c |NARCRC $|repo, "\|
|00001a30| 6e 22 3b 0a 66 6f 72 28 | 24 69 3d 31 3b 20 24 69 |n";.for(|$i=1; $i|
|00001a40| 20 3c 20 24 6e 61 72 63 | 5f 69 6e 64 65 78 3b 20 | < $narc|_index; |
|00001a50| 24 69 2b 2b 29 0a 09 7b | 0a 09 70 72 69 6e 74 20 |$i++)..{|..print |
|00001a60| 4e 41 52 43 52 43 20 24 | 6e 61 72 63 5f 6c 69 6e |NARCRC $|narc_lin|
|00001a70| 65 5b 24 69 5d 2c 20 22 | 5c 6e 22 3b 0a 09 7d 0a |e[$i], "|\n";..}.|
|00001a80| 23 20 73 6f 66 74 77 61 | 72 65 20 45 4f 46 0a 70 |# softwa|re EOF.p|
|00001a90| 72 69 6e 74 20 4e 41 52 | 43 52 43 20 22 45 4f 46 |rint NAR|CRC "EOF|
|00001aa0| 5c 6e 22 3b 0a 63 6c 6f | 73 65 28 3c 4e 41 52 43 |\n";.clo|se(<NARC|
|00001ab0| 52 43 3e 29 3b 0a 70 72 | 69 6e 74 20 22 5c 6e 22 |RC>);.pr|int "\n"|
|00001ac0| 3b 0a 0a 23 20 53 75 62 | 72 6f 75 74 69 6e 65 20 |;..# Sub|routine |
|00001ad0| 74 6f 20 72 65 74 75 72 | 6e 20 74 68 65 20 63 75 |to retur|n the cu|
|00001ae0| 72 72 65 6e 74 20 64 61 | 74 65 20 61 6e 64 20 74 |rrent da|te and t|
|00001af0| 69 6d 65 20 69 6e 0a 23 | 20 6e 6e 74 70 20 66 6f |ime in.#| nntp fo|
|00001b00| 72 6d 61 74 2c 20 77 68 | 69 63 68 20 69 73 20 22 |rmat, wh|ich is "|
|00001b10| 59 59 4d 4d 44 44 20 48 | 48 4d 4d 53 53 22 0a 23 |YYMMDD H|HMMSS".#|
|00001b20| 0a 73 75 62 20 6e 6f 77 | 0a 09 7b 0a 09 28 24 73 |.sub now|..{..($s|
|00001b30| 65 63 2c 24 6d 69 6e 2c | 24 68 6f 75 72 2c 24 6d |ec,$min,|$hour,$m|
|00001b40| 64 61 79 2c 24 6d 6f 6e | 2c 24 79 65 61 72 2c 24 |day,$mon|,$year,$|
|00001b50| 77 64 61 79 2c 24 79 64 | 61 79 2c 24 69 73 64 73 |wday,$yd|ay,$isds|
|00001b60| 74 29 20 3d 20 6c 6f 63 | 61 6c 74 69 6d 65 28 74 |t) = loc|altime(t|
|00001b70| 69 6d 65 28 29 29 3b 0a | 09 24 6d 6f 6e 2b 2b 3b |ime());.|.$mon++;|
|00001b80| 0a 09 73 70 72 69 6e 74 | 66 28 22 25 30 32 64 25 |..sprint|f("%02d%|
|00001b90| 30 32 64 25 30 32 64 20 | 25 30 32 64 25 30 32 64 |02d%02d |%02d%02d|
|00001ba0| 25 30 32 64 22 2c 20 24 | 79 65 61 72 2c 24 6d 6f |%02d", $|year,$mo|
|00001bb0| 6e 2c 24 6d 64 61 79 2c | 24 68 6f 75 72 2c 24 6d |n,$mday,|$hour,$m|
|00001bc0| 69 6e 2c 24 73 65 63 29 | 3b 0a 09 7d 0a 0a 73 75 |in,$sec)|;..}..su|
|00001bd0| 62 20 68 61 6e 64 6c 65 | 72 0a 09 7b 0a 09 6c 6f |b handle|r..{..lo|
|00001be0| 63 61 6c 28 24 73 69 67 | 29 20 3d 20 40 5f 3b 0a |cal($sig|) = @_;.|
|00001bf0| 09 70 72 69 6e 74 20 22 | 5c 6e 5c 6e 43 61 75 67 |.print "|\n\nCaug|
|00001c00| 68 74 20 73 69 67 6e 61 | 6c 20 24 73 69 67 20 2d |ht signa|l $sig -|
|00001c10| 2d 20 65 78 69 74 69 6e | 67 20 24 41 52 47 56 5b |- exitin|g $ARGV[|
|00001c20| 30 5d 5c 6e 22 3b 0a 09 | 63 6c 6f 73 65 28 3c 41 |0]\n";..|close(<A|
|00001c30| 52 54 49 43 4c 45 3e 29 | 3b 0a 09 63 6c 6f 73 65 |RTICLE>)|;..close|
|00001c40| 28 3c 42 4f 44 59 3e 29 | 3b 0a 09 63 6c 6f 73 65 |(<BODY>)|;..close|
|00001c50| 28 3c 4d 53 47 49 44 53 | 3e 29 3b 0a 09 63 6c 6f |(<MSGIDS|>);..clo|
|00001c60| 73 65 28 3c 4e 41 52 43 | 52 43 3e 29 3b 0a 09 63 |se(<NARC|RC>);..c|
|00001c70| 6c 6f 73 65 28 3c 53 41 | 56 45 46 49 4c 45 3e 29 |lose(<SA|VEFILE>)|
|00001c80| 3b 0a 09 65 78 69 74 20 | 30 3b 0a 09 7d 0a 0a 73 |;..exit |0;..}..s|
|00001c90| 75 62 20 6d 6b 70 61 74 | 68 0a 09 7b 0a 09 6c 6f |ub mkpat|h..{..lo|
|00001ca0| 63 61 6c 28 24 66 75 6c | 6c 70 61 74 68 29 20 3d |cal($ful|lpath) =|
|00001cb0| 20 40 5f 3b 0a 09 6c 6f | 63 61 6c 28 40 74 72 65 | @_;..lo|cal(@tre|
|00001cc0| 65 29 20 3d 20 73 70 6c | 69 74 28 27 2f 27 2c 20 |e) = spl|it('/', |
|00001cd0| 24 66 75 6c 6c 70 61 74 | 68 29 3b 0a 09 6c 6f 63 |$fullpat|h);..loc|
|00001ce0| 61 6c 28 40 74 6d 70 29 | 20 3d 20 28 29 3b 0a 0a |al(@tmp)| = ();..|
|00001cf0| 09 69 66 28 24 74 72 65 | 65 5b 30 5d 20 65 71 20 |.if($tre|e[0] eq |
|00001d00| 22 22 29 0a 09 09 7b 0a | 09 09 70 75 73 68 28 40 |"")...{.|..push(@|
|00001d10| 74 6d 70 2c 20 73 68 69 | 66 74 28 40 74 72 65 65 |tmp, shi|ft(@tree|
|00001d20| 29 29 3b 0a 09 09 7d 0a | 09 66 6f 72 65 61 63 68 |));...}.|.foreach|
|00001d30| 20 24 64 69 72 20 28 40 | 74 72 65 65 29 0a 09 09 | $dir (@|tree)...|
|00001d40| 7b 0a 09 09 70 75 73 68 | 28 40 74 6d 70 2c 20 24 |{...push|(@tmp, $|
|00001d50| 64 69 72 29 3b 0a 09 09 | 24 70 61 74 68 20 3d 20 |dir);...|$path = |
|00001d60| 6a 6f 69 6e 28 27 2f 27 | 2c 20 40 74 6d 70 29 3b |join('/'|, @tmp);|
|00001d70| 0a 09 09 70 72 69 6e 74 | 20 22 5c 74 25 25 20 63 |...print| "\t%% c|
|00001d80| 68 65 63 6b 69 6e 67 20 | 66 6f 72 20 27 24 70 61 |hecking |for '$pa|
|00001d90| 74 68 27 5c 6e 22 20 69 | 66 20 24 76 65 72 62 6f |th'\n" i|f $verbo|
|00001da0| 73 65 3b 0a 09 09 6d 6b | 64 69 72 28 22 24 70 61 |se;...mk|dir("$pa|
|00001db0| 74 68 22 2c 20 30 37 37 | 37 29 20 7c 7c 20 64 69 |th", 077|7) || di|
|00001dc0| 65 20 22 43 61 6e 27 74 | 20 63 72 65 61 74 65 20 |e "Can't| create |
|00001dd0| 64 69 72 65 63 74 6f 72 | 79 20 24 70 61 74 68 22 |director|y $path"|
|00001de0| 0a 09 09 09 69 66 20 21 | 20 2d 64 20 22 24 70 61 |....if !| -d "$pa|
|00001df0| 74 68 22 3b 0a 09 09 7d | 0a 09 7d 09 0a 0a 23 20 |th";...}|..}...# |
|00001e00| 45 6d 61 63 73 20 63 75 | 74 73 6f 6d 69 73 61 74 |Emacs cu|tsomisat|
|00001e10| 69 6f 6e 0a 23 0a 23 20 | 4c 6f 63 61 6c 20 56 61 |ion.#.# |Local Va|
|00001e20| 72 69 61 62 6c 65 73 3a | 0a 23 20 6d 6f 64 65 3a |riables:|.# mode:|
|00001e30| 66 75 6e 64 61 6d 65 6e | 74 61 6c 0a 23 20 74 61 |fundamen|tal.# ta|
|00001e40| 62 2d 77 69 64 74 68 3a | 34 0a 23 20 45 6e 64 3a |b-width:|4.# End:|
|00001e50| 0a 53 48 41 52 5f 45 4f | 46 0a 63 68 6d 6f 64 20 |.SHAR_EO|F.chmod |
|00001e60| 2b 78 20 27 6e 61 72 63 | 2e 70 6c 27 0a 23 09 45 |+x 'narc|.pl'.#.E|
|00001e70| 6e 64 20 6f 66 20 73 68 | 65 6c 6c 20 61 72 63 68 |nd of sh|ell arch|
|00001e80| 69 76 65 0a 65 78 69 74 | 20 30 0a 52 65 69 64 20 |ive.exit| 0.Reid |
|00001e90| 45 6c 6c 69 73 20 20 32 | 36 34 20 42 72 6f 61 64 |Ellis 2|64 Broad|
|00001ea0| 77 61 79 20 41 76 65 6e | 75 65 2c 20 54 6f 72 6f |way Aven|ue, Toro|
|00001eb0| 6e 74 6f 20 4f 4e 2c 20 | 4d 34 50 20 31 56 39 20 |nto ON, |M4P 1V9 |
|00001ec0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 43 61 | | Ca|
|00001ed0| 6e 61 64 61 0a 72 61 65 | 40 67 70 75 2e 75 74 63 |nada.rae|@gpu.utc|
|00001ee0| 73 2e 74 6f 72 6f 6e 74 | 6f 2e 65 64 75 20 7c 7c |s.toront|o.edu |||
|00001ef0| 20 72 61 65 25 61 6c 69 | 61 73 40 63 73 72 69 2e | rae%ali|as@csri.|
|00001f00| 74 6f 72 6f 6e 74 6f 2e | 65 64 75 20 7c 7c 20 2b |toronto.|edu || +|
|00001f10| 31 20 34 31 36 20 34 38 | 37 20 31 33 38 33 0a |1 416 48|7 1383. |
+--------+-------------------------+-------------------------+--------+--------+