DataMuseum.dk

Presents historical artifacts from the history of:

Commodore CBM-900

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

See our Wiki for more about Commodore CBM-900

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦93da927c2⟧ TextFile

    Length: 368 (0x170)
    Types: TextFile
    Notes: UNIX file
    Names: »fil.c«

Derivation

└─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code
    └─⟦2d53db1df⟧ UNIX V7 Filesystem
        └─ ⟦this⟧ »frankh/tmp/fil.c« 

TextFile

#include	<stdio.h>


main()
{

int fd0, fd1, i;
char *buf, *cr;

	cr = "\n";
	buf = " ";

	fd0 = open("doc", 0);
	fd1 = open("doc.strip", 1);

	i = 0;

	while(read(fd0,buf,1) != 0) {

		*buf &= 0x7f;			/* 0-7 bits only */
		printf("%s", buf);
		write(fd1, buf, 1);
		if (++i > 70) {
			i = 0;
			printf("^\n");
			write(fd1, cr, 1);
		}
	}
	close(fd0);
	close(fd1);
}