home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V7 / usr / src / cmd / standalone / cat.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-24  |  168 b   |  16 lines

  1. main()
  2. {
  3.     int c, i;
  4.     char buf[50];
  5.  
  6.     do {
  7.         printf("File: ");
  8.         gets(buf);
  9.         i = open(buf, 0);
  10.     } while (i <= 0);
  11.  
  12.     while ((c = getc(i)) > 0)
  13.         putchar(c);
  14.     exit(0);
  15. }
  16.