From 29b027d4f4502b231bddc93476fa3d7718ea8180 Mon Sep 17 00:00:00 2001 From: Oliver Lehmann Date: Mon, 3 Apr 1989 17:40:32 +0000 Subject: [PATCH] ING_DB --- WEGA/contrib/ingres/dbs/src/gutil/cat.c | 30 +++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 WEGA/contrib/ingres/dbs/src/gutil/cat.c 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); +}