]>
diplodocus.org Git - nmh/blob - sbr/cpydata.c
3 * cpydata.c -- copy all data from one fd to another
5 * This code is Copyright (c) 2002, by the authors of nmh. See the
6 * COPYRIGHT file in the root directory of the nmh distribution for
7 * complete copyright information.
13 cpydata (int in
, int out
, const char *ifile
, const char *ofile
)
18 while ((i
= read(in
, buffer
, sizeof(buffer
))) > 0) {
19 if (write(out
, buffer
, i
) != i
)
20 adios(ofile
, "error writing");
24 adios(ifile
, "error reading");