CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Wed, 16 Jul 2025 22:55:50 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20090210084800
location: https://web.archive.org/web/20090210084800/https://examples.oreilly.com/upt2/split/bsplit.shar
server-timing: captures_list;dur=0.480415, exclusion.robots;dur=0.016864, exclusion.robots.policy;dur=0.008339, esindex;dur=0.010429, cdx.remote;dur=9.734856, LoadShardBlock;dur=329.350056, PetaboxLoader3.datanode;dur=153.156200, PetaboxLoader3.resolve;dur=34.306251
x-app-server: wwwb-app219
x-ts: 302
x-tr: 361
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: SERVER=wwwb-app219; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Wed, 16 Jul 2025 22:55:51 GMT
content-type: application/x-shar
content-length: 5037
x-archive-orig-date: Tue, 10 Feb 2009 08:48:00 GMT
x-archive-orig-server: Apache
x-archive-orig-last-modified: Mon, 31 Mar 2008 18:10:12 GMT
x-archive-orig-etag: "8ae92f-13ad-90194900"
x-archive-orig-accept-ranges: bytes
x-archive-orig-content-length: 5037
x-archive-orig-connection: close
cache-control: max-age=1800
x-archive-guessed-content-type: application/x-shar
x-archive-guessed-charset: utf-8
memento-datetime: Tue, 10 Feb 2009 08:48:00 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Wed, 19 Jun 2002 01:48:17 GMT", ; rel="prev memento"; datetime="Wed, 18 Oct 2006 00:15:16 GMT", ; rel="memento"; datetime="Tue, 10 Feb 2009 08:48:00 GMT", ; rel="next memento"; datetime="Wed, 30 Sep 2015 16:47:10 GMT", ; rel="last memento"; datetime="Fri, 25 Mar 2016 03:18:16 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_8_20090210075601_crawl103-c/52_8_20090210084506_crawl100.arc.gz
server-timing: captures_list;dur=0.513246, exclusion.robots;dur=0.021197, exclusion.robots.policy;dur=0.009941, esindex;dur=0.011800, cdx.remote;dur=13.342435, LoadShardBlock;dur=737.249896, PetaboxLoader3.resolve;dur=200.051568, PetaboxLoader3.datanode;dur=94.830668, load_resource;dur=163.700776
x-app-server: wwwb-app219
x-ts: 200
x-tr: 940
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
accept-ranges: bytes
Path: xanth!nic.MR.NET!hal!ncoast!allbery
From: knop@dutesta.UUCP (Peter Knoppers, Delft Univ. of Technology)
Newsgroups: comp.sources.misc
Subject: v05i083: bsplit - a split-like program for binary files
Message-ID: <1238@dutesta.UUCP>
Date: 14 Dec 88 03:10:06 GMT
Sender: allbery@ncoast.UUCP
Reply-To: knop@dutesta.UUCP (Peter Knoppers, Delft Univ. of Technology)
Organization: DELFT UNIVERSITY OF TECHNOLOGY Faculty of Electrical Engineering Computer architecture and Digital Technique Mekelweg 4 - 2628 CD Delft
Lines: 162
Approved: allbery@ncoast.UUCP
Posting-number: Volume 5, Issue 83
Submitted-by: "Peter Knoppers, Delft Univ. of Technology"
Archive-name: bsplit
Below follows my program bsplit.c. It is a short and simple program
that we use rather often. Manual is not included, as the use is
almost identical to that of the un*x split program. As furnished
it compiles and works on the systems that I tried. It may not
work on systems where ints are 16 bits. For local use you may
change this program into anything you like.
Modified versions must not be re-distributed. Distribution of the
original version with diff is OK. If someone really improves this,
mail the diffs to me, so that I can re-post the really-improved
version. The copyright message is there to prevent uncontrolled
spreading of many slightly different versions.
My present email address is knop@dutesta.UUCP, this will soon
change to knop@duteca.UUCP.
#! /bin/sh
# This file was wrapped with "dummyshar". "sh" this file to extract.
# Contents: bsplit.c
echo extracting 'bsplit.c'
if test -f 'bsplit.c' -a -z "$1"; then echo Not overwriting 'bsplit.c'; else
sed 's/^X//' << \EOF > 'bsplit.c'
X/*
X * bsplit.c - split binary files in manageable pieces.
X * usage is exactly like the split program.
X *
X * This program was written from scratch, without looking at the
X * sources of split.
X *
X * Copyright (C) 1988 P. Knoppers
X * Bilderdijkhof 59
X * 2624 ZG Delft
X * The Netherlands
X */
X
Xchar copy0[] = "Copyright (C) 1988 P. Knoppers";
Xchar copy1[] = "Permission to use and distribute copies of this";
Xchar copy2[] = "program WITH SOURCE is granted to anyone, provided";
Xchar copy3[] = "that it is NOT CHANGED in any way.";
X
X#include
X#define DEFSIZE 50000
X#define DEFPREFIX "x"
X#define MAXNAME 200
X
Xchar *malloc ();
X
Xmain (argc, argv) /* bsplit - split binary file */
Xchar *argv[];
X{
X char *buf;
X char *myname;
X int bulksize = DEFSIZE;
X int level;
X int got;
X int fno = 0;
X char outfname[MAXNAME + 1];
X char outbase[MAXNAME + 3];
X int foundinname = 0;
X FILE * infile = stdin;
X FILE * outfile;
X
X myname = *argv;
X strcpy (outbase, DEFPREFIX);
X while (--argc > 0)
X {
X argv++;
X if ((*argv)[0] == '-')
X {
X if ((*argv)[1] == '\0')
X {
X if (foundinname != 0)
X {
X fprintf (stderr,
X "usage: %s [-size] [file [prefix]]\n",
X myname);
X exit (1);
X }
X foundinname++;
X }
X else
X if (sscanf (*argv, "-%d", &bulksize) != 1)
X {
X fprintf (stderr,
X "usage: %s [-size] [file [prefix]]\n",
X myname);
X exit (1);
X }
X }
X else
X if (foundinname != 0)
X {
X if (strlen (*argv) > MAXNAME)
X {
X fprintf (stderr, "%s: prefix too long\n",
X myname);
X exit (1);
X }
X strcpy (outbase, *argv);
X }
X else
X {
X if ((infile = fopen (*argv, "r")) == NULL)
X {
X fprintf (stderr, "%s: cannot open %s\n",
X myname, *argv);
X exit (1);
X }
X foundinname++;
X }
X }
X
X if ((buf = malloc (bulksize)) == NULL)
X {
X fprintf (stderr, "%s: malloc failed\n", myname);
X exit (1);
X }
X level = 0;
X while (1)
X {
X got = read (fileno (infile), &buf[level], bulksize - level);
X level += got;
X if ((level < bulksize) && (got > 0))
X continue;
X if ((level == bulksize) || ((got == 0) && (level > 0)))
X {
X sprintf (outfname, "%s%c%c", outbase, fno / 26 + 'a',
X fno % 26 + 'a');
X if ((outfile = fopen (outfname, "w")) == NULL)
X {
X fprintf (stderr, "%s: cannot create %s\n", myname,
X outfname);
X exit (1);
X }
X if (write (fileno (outfile), buf, level) != level)
X {
X fprintf (stderr, "%s: write failed\n", myname);
X exit (1);
X }
X fclose (outfile);
X level = 0;
X fno++;
X }
X if (got == 0)
X break;
X }
X}
EOF
chars=`wc -c < 'bsplit.c'`
if test $chars != 2804; then echo 'bsplit.c' is $chars characters, should be 2804 characters!; fi
fi
exit 0
--
_____ __ __ __ __ ____ _____ _____ ______ _____ _____
| _ \ | |/ || \| | / \ | _ \ | _ \ | ___|| _ \ / ___|
| __/ _ | < | || || || __/ | __/ | >__ | < \__ \
|__| |_| |__|\__||__|\__| \____/ |__| |__| |______||__|\__||_____/
P. Knoppers, Delft Univ. of Technology, The Netherlands - knop@dutesta.UUCP