🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: biz.pagesat
Article #1

Re: Web transmission spec

#1
From: Chris Fourroux
Date: Fri, 02 Feb 2024 17:51
75 lines
3118 bytes
On Monday, September 30, 1996 at 12:00:00 AM UTC-7, Chris Fourroux wrote:
> Jack Kilday wrote:
> >
> > The companion program to which Norman refers is not yet available, but
> And for those of you that can't wait:
> /*
> 9/30/96 -Chris Fourroux (op...@opie.com)
> Utility to extract multiple binary image files
> from one text file of new NCIT "url" type.
> Used Turbo C to compile and test on DOS system.
> I tried to keep this as portable as I could, But I don't claim
> to be a programmer.
> */
> #include <string.h>
> #include <stdio.h>
> #include <stdarg.h>
> int main(int argv,char *argc[])
> {
> FILE *stream,*out;
> char msg[81],*ptr;
> char string[4][80];
> char fn[21];
> unsigned long size=0,l=0;
> int i;
> char buf[2048];
> if (argv<2){
> printf("format \"GETIMAGE FILENAME\"\r\n");
> return 1;
> }
> if ((stream = fopen(argc[1], "r+b"))
> == NULL)
> {
> fprintf(stderr, "Cannot open input file.\n");
> return 1;
> }
> while (!feof(stream)){
> fgets(msg, 80, stream);
> if (!feof(stream)){
> sscanf(msg,"%s %lu", &string[1], &size);
> if (strncmp(string[1],"http",4)!=0){
> printf("Invalid input file\r\n");
> fclose(stream);
> return 1;
> }
> ptr = strrchr(string[1],'/');
> sprintf(fn,"%s",&string[1][ptr-string[1]+1]);
> if ((out=fopen(fn,"w+b"))== NULL){
> fprintf(stderr, "Cannot open %s .\n",fn);
> return 1;
> }
> i=0;
> l=0;
> while (l<size){
> if ((l+2048)<size)
> i=2048;
> else
> i=(size-l);
> fread(buf,1,i,stream);
> fwrite(buf,1, i,out);
> l+=i;
> }
> fclose(out);
> printf("%s\r\n",string[1]);
> printf("%lu Bytes written\r\n",size);
> }
> }
> fclose(stream);
> return 0;
> }


28 years later, near the end of usenet (google will no longer allow new posts to usenet groups as of 2/22/2024)
I do , in fact, now claim to be a programmer.
Technical Details
Message-ID: <b5710c73-c78d-4ec3-a12f-107638603e3dn@googlegroups.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!archive!apf1.newsdeef.eu!not-for-mail
References: <52ecoe$9g7@jolt.pagesat.net> <DyEMKK.npB@server.nlbbs.com> <3250A796.1B40@opie.com>#1/1>

Show Full Headers
Complete Article Headers
Message-ID: <b5710c73-c78d-4ec3-a12f-107638603e3dn@googlegroups.com>
Subject: Re: Web transmission spec
Date: Fri, 02 Feb 2024 17:51:29 +0000
From: Chris Fourroux <cfourroux@gmail.com>
References: <52ecoe$9g7@jolt.pagesat.net> <DyEMKK.npB@server.nlbbs.com> <3250A796.1B40@opie.com>#1/1>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!archive!apf1.newsdeef.eu!not-for-mail
X-Received: by 2002:a05:620a:2792:b0:785:6013:89e2 with SMTP id g18-20020a05620a279200b00785601389e2mr9579qkp.5.1706896289763; Fri, 02 Feb 2024 09:51:29 -0800 (PST)
X-Received: by 2002:a05:620a:2483:b0:785:3c8e:ba3d with SMTP id i3-20020a05620a248300b007853c8eba3dmr31762qkn.9.1706896289544; Fri, 02 Feb 2024 09:51:29 -0800 (PST)
Newsgroups: biz.pagesat
In-Reply-To: <3250A796.1B40@opie.com>#1/1>
Injection-Info: google-groups.googlegroups.com; posting-host=98.97.113.67; posting-account=pEbHOQoAAAB5Ug3rho58HKE9nkWzcoP8
Nntp-Posting-Host: 98.97.113.67
User-Agent: G2/1.0
Mime-Version: 1.0
Injection-Date: Fri, 02 Feb 2024 17:51:29 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable