🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #8708

Re: What's the problem?

#8708
From: David Woolley
Date: Sat, 22 Jun 1996 00:00
41 lines
1923 bytes
In article <DqtwxA3ibtQc090yn@ibm.net>, Jacques Jamain <jamain@ibm.net> wrote:
>
>My experience is that the end of stream from the news server
>is always: "crlf.\0" (w/o "), no ending crlf.

That's broken.  What news server are you using.  I've accessed nntp-1.5.*,
INN and Demon's NewsBorg and they all give CR LF . CF LF, such that the
following script will correctly parse the articles.

#! /usr/bin/perl
$batchsize = 300000;
$batchseq = "aaa";
$articleend=0;
open (batchfile, ">batch${batchseq}.txt");
while (<STDIN> ) {
    if (/^220 /) {
        if ($articleend > $batchsize) {
            close batchfile;
            $batchseq ++;
            open (batchfile, ">batch${batchseq}.txt");
            $articleend = 0;
        }
        $currentarticle = "";
        while (  <STDIN>) { 
            s/\r$//;
            last if (/^\.$/);

            s/^\.//;
            $currentarticle .= $_;
        }
        $articlesize = length $currentarticle;
        print batchfile "#! rnews ". $articlesize ."\n";
        print batchfile $currentarticle;
        $articleend += $articlesize;
    }
}
-- 
David Woolley, London, England          david@djwhome.demon.co.uk

Technical Details
Message-ID: <DtEp9M.EFq@djwhome.demon.co.uk>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
References: <4praqc$1om@netnews.ntu.edu.tw> <DqtwxA3ibtQc090yn@ibm.net>

Show Full Headers
Complete Article Headers
Message-ID: <DtEp9M.EFq@djwhome.demon.co.uk>
Subject: Re: What's the problem?
Date: Sat, 22 Jun 1996 00:00:00 +0000
From: David Woolley <david@djwhome.demon.co.uk>
References: <4praqc$1om@netnews.ntu.edu.tw> <DqtwxA3ibtQc090yn@ibm.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
X-Deja-AN: 161681191
Distribution: inet
X-nntp-posting-host: djwhome.demon.co.uk
Sender: news <news@djwhome.demon.co.uk>
X-mail2news-path: djwhome.demon.co.uk
Organization: Demon Subscriber at Home
Newsgroups: news.software.nntp