]> diplodocus.org Git - nmh/blob - docs/historical/SRI-NOSC/subs.dir/showfile.c
expect this commit to be force-replaced periodically
[nmh] / docs / historical / SRI-NOSC / subs.dir / showfile.c
1 showfile(file)
2 {
3 register int i, cnt;
4 char buf[512];
5
6 type(1, "\n");
7 if((i = open(file, 0)) == -1) {
8 printf("Can't open %s\n", file);
9 return 1;
10 }
11 do
12 if((cnt = read(i, buf, sizeof buf)) > 0)
13 write(1, buf, cnt);
14 while(cnt == sizeof buf);
15 close(i);
16 type(1, "\n");
17 return 0;
18 }