/*****************************************************************/
/* Operating Systems Concepts (MSc Conv / JMC2) 2003/'04         */
/*                                                               */
/* typeout.c - C program to type out the contents of a text file */
/*                                                               */
/* Olav Beckmann 2003-11-20                                      */
/*****************************************************************/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#define length 100

int main( int argc, char *argv[] ) {
  FILE *file;
  char buffer[length];

  assert( argc == 2 );
  file = fopen( argv[1], "r" );
  while( fgets( buffer, length, file ) ) {
    fputs( buffer, stdout );
  }
  fclose( file );
  return 0;
}

