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