sending binary files via telephone

tut at ucbopal.CC.Berkeley.ARPA tut at ucbopal.CC.Berkeley.ARPA
Sun Apr 1 11:21:32 AEST 1984


Reading the System V manual, I noticed that USG Unix doesn't have
uuencode or uudecode.  After thinking about it, I wasn't sure why
they are necessary anyway.  It seems you can transmit binary files
using two simple C programs, such as `hex' and `unhex':
-----------------
#include <stdio.h>
main()			/* hex.c - binary to hex */
{
	int c;

	while ((c = getchar()) != EOF)
		printf("%02x", c);
	exit(0);
}
-----------------
#include <stdio.h>
main()			/* unhex.c - hex to binary */
{
	int c;

	while (scanf("%2x", &c) != EOF)
		putchar(c);
	exit(0);
}
-----------------
Are there any problems I don't know about here?  Are uuencode
and uudecode necessary because mailers require newlines every
so often?

Bill Tuthill
ucbvax!imagen!tut



More information about the Comp.unix mailing list