talk session

Greg Whitlock greg at athena.cs.uga.edu
Tue May 7 10:05:21 AEST 1991


Recently there was a post concerning the capturing of a 'talk'
session.  One reply was to issue the 'talk' command in the
following format: 
		 talk <whoever> | tee <filename>
and your talk session would be captured in the file <filename>.

It is then fun to simply: cat <filename>
and watch your whole talk session be recreated.  However, it is 
nearly impossible to read and since <filename> contains all the
control characters from your session, it is a pain to read other-
wise.

A friend of mine wrote this neat little c program called 
'scat' (for slow cat) which will display the talk session
or other text file in reduced speed. Just specify the length
of the delay.  The default is 30.

Hope this helps someone.

------------------------>cut here<------------------------------
/*
 *
 *	scat - written by gordon.edwards at atlantaga.ncr.com
 *
 *	This short program displays the contents of a file with delays
 *	after each line.  
 *
 *	Invoke with the filename and optional delay on the command line.
 *
 *	Example:
 *
 *		scat filename or
 *		scat filename 40
 *
 *	If no delay is specified then 30 is used as the default.
 */

#include <stdio.h>

main(argc, argv)
int argc;
char *argv[];
{
	int c, delay, i;
	FILE *fopen(), *fp;

	if (argc < 2)
	{
		printf("usage: %s filename [delay]\n", argv[0]);
		exit(-1);
	}

	if ((fp = fopen(argv[1], "r")) == NULL)
	{
		printf("%s: Can't open file %s\n", argv[0], argv[1]);
		exit(-1);
	}

	if (argc < 3)
		delay = 30*1000;
	else
	{
		sscanf(argv[2], "%d", &i);
		delay = i * 1000;
	}

	while ((c = getc(fp)) != EOF)
	{
		printf("%c", c);
		for (i = 0; i < delay; i++)
			;
	}

	fclose(fp);
}
-- 



=============================================================================



More information about the Comp.unix.wizards mailing list