ftp.nice.ch/pub/next/unix/mail/mh.6.7.s.tar.gz#/mh/sbr/cpydata.c

This is cpydata.c in view mode; [Download] [Up]

/* cpydata.c - copy from one fd to another */

#include "../h/mh.h"
#include <stdio.h>


void cpydata (in, out, ifile, ofile)
register int    in,
                out;
register char  *ifile,
               *ofile;
{
    register int    i;
    char    buffer[BUFSIZ];

    while ((i = read (in, buffer, sizeof buffer)) > 0)
	if (write (out, buffer, i) != i)
	    adios (ofile, "error writing");

    if (i == NOTOK)
	adios (ifile, "error reading");
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.