🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #63012

Re: NNTP and YENC

#63012
From: Claus Färber
Date: Fri, 10 Jan 2003 16:57
49 lines
3064 bytes
Jeremy <jeremy@exit109.com> schrieb/wrote:
> Phil <PeepingUnder@TheCovers.org> wrote:
>> The test is taking a piece of C code using stdio.h, compile it on
>> DOS/Windows or Unix/Linux, and running it on both.  The result should be
>> identical.

> But whatever gave you that idea?  C code isn't inherently portable;

No, Phil is right. The problem is that you can't expect it to produce  
the same result without converting the input data to local conventions  
for text and binary files:
The C specification does only make some guarantees about data written to  
and from text and binary streams but it does not define the mapping from
these streams to the data that it actually stored on disk.

> you have to make it portable by working around platform-specific
> quirks. In your case, this is one of them.

It's not platform-specific quirks but making assumptions that the C  
standard does not guarantee.

> If you want to process data from Usenet, you're going to have to open
> it in binary mode.

Yes, this is the solution because the C standard guarantees that "binary
streams" are able to save any char values, whereas "text streams" can't
handle all data allowed by Netnews standards.

But that suddenly exposes us to ...

> Which, in fact, *would* be pretty portable, since Unix systems ignore
> the "b".

... the quirks found on Unix systems: On these systems, Netnews data is
usually stored in what maps to C's "text mode". However, the assumption  
that this is possible is only true on POSIX systems but not guaranteed  
by the C specification.

The original poster is also making the assumption that his platform can
handle Netnews data as "text streams" and that ports of text utilities
can handle it. This is true on POSIX systems but not on his system.
There's *nothing* broken here, except that his assumptions are not valid
on his non-POSIX system.

Claus
-- 
------------------------ http://www.faerber.muc.de/ ------------------------
OpenPGP: DSS 1024/639680F0 E7A8 AADB 6C8A 2450 67EA AF68 48A5 0E63 6396 80F0
Technical Details
Message-ID: <8d$Rtvs3cDD@3247.org>
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!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!newsfeed.vmunix.org!fu-berlin.de!informatik.tu-muenchen.de!news.muc.de!faerber.muc.de!claus
References: <BXLR9.432835$pN3.48082@sccrnsc03> <1041772747.319829@ok-corral.gunslinger.net> <BiqS9.160$wz1.152433@news.uswest.net> <1042007522.340079@ok-corral.gunslinger.net>

Show Full Headers
Complete Article Headers
Message-ID: <8d$Rtvs3cDD@3247.org>
Subject: Re: NNTP and YENC
Date: Fri, 10 Jan 2003 16:57:00 +0000
From: claus-usenet-20030110@faerber.muc.de (Claus Färber)
References: <BXLR9.432835$pN3.48082@sccrnsc03> <1041772747.319829@ok-corral.gunslinger.net> <BiqS9.160$wz1.152433@news.uswest.net> <1042007522.340079@ok-corral.gunslinger.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!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!newsfeed.vmunix.org!fu-berlin.de!informatik.tu-muenchen.de!news.muc.de!faerber.muc.de!claus
Newsgroups: news.software.nntp
User-Agent: OpenXP/32 v3.9.3 (Win32) alpha @ 2003-01-10-1455d
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Organization: There Is No Organization
Lines: 48