diff --git a/WEGA/contrib/ingres/dbs/src/gutil/cat.c b/WEGA/contrib/ingres/dbs/src/gutil/cat.c new file mode 100644 index 0000000..fb1290e --- /dev/null +++ b/WEGA/contrib/ingres/dbs/src/gutil/cat.c @@ -0,0 +1,30 @@ +# include + +/* +** CAT -- "cat" a file +** +** This function is essentially identical to the cat(1). +** +** Parameters: +** file -- the name of the file to be cat'ed +** +** Returns: +** zero -- success +** else -- failure (could not open file) +*/ +AAcat(file) +register char *file; +{ + register int i; + register int fd; + char buf[BUFSIZ]; + + if ((fd = open(file, 0)) < 0) + return (1); + + while ((i = read(fd, buf, BUFSIZ)) > 0) + write(1, buf, i); + + close(fd); + return (0); +}