DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ T c

⟦3b5094fe5⟧ TextFile

    Length: 539 (0x21b)
    Types: TextFile
    Names: »cat.c«

Derivation

└─⟦87ddcff64⟧ Bits:30001253 CPHDIST85 Tape, 1985 Autumn Conference Copenhagen
    └─ ⟦this⟧ »cph85dist/stat/src/cat.c« 

TextFile

/* very simple versoin of cat for systems without cat */
#include <stdio.h>

main (argc, argv) char **argv;
	{
	FILE	*ioptr;
	while (--argc)
		{
		++argv;
		if (*argv[0] == '-' && *argv[1] == '\0')
			copyout (stdin);
		else
			{
			ioptr = fopen (*argv, "r");
			if (ioptr == NULL)
				{
				fprintf (stderr, "cat: can't open '%s'\n", *argv);
				exit (1);
				}
			copyout (ioptr);
			fclose (ioptr);
			}
		}
	exit (0);
	}

copyout (ioptr)
register	FILE	*ioptr;
	{
	register	int 	C;
	while ((C = getc (ioptr)) != EOF)
		putchar (C);
	}