3 * --- T2-COPYRIGHT-NOTE-BEGIN ---
4 * This copyright note is auto-generated by ./scripts/Create-CopyPatch.
6 * T2 SDE: misc/archive/ccat.c
7 * Copyright (C) 2004 - 2005 The T2 SDE Project
8 * Copyright (C) 1998 - 2003 ROCK Linux Project
10 * More information can be found in the files COPYING and README.
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; version 2 of the License. A copy of the
15 * GNU General Public License can be found in the file COPYING.
16 * --- T2-COPYRIGHT-NOTE-END ---
19 #define VERSION "2000-06-15"
26 char s1
[]="................................"
27 "................................";
33 "ccat (counting cat) Version " VERSION
"\n"
34 "Copyright (C) 2000 Clifford Wolf, Thomas Baumgartner\n"
36 " This program is free software; you can redistribute it and/or modify\n"
37 " it under the terms of the GNU General Public License as published by\n"
38 " the Free Software Foundation; either version 2 of the License, or\n"
39 " (at your option) any later version.\n"
41 " This program is distributed in the hope that it will be useful,\n"
42 " but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
43 " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
44 " GNU General Public License for more details.\n"
46 " You should have received a copy of the GNU General Public License\n"
47 " along with this program; if not, write to the Free Software\n"
48 " Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n"
50 "Usage: `ccat' reads from its stdin and writes to stdout. No command line\n"
51 " arguments ar allowed. A status bar is printed to stderr.\n\n"
59 fprintf(stderr
,"\r%6d0 MB [%s]\r%6d0 MB [",
60 c
/1024,s1
,c
/1024); fflush(stderr
);
62 if ( (rc1
=read(0,buf
,10240)) <= 0 ) { rc2
=rc1
; break; }
64 fprintf(stderr
,"X"); fflush(stderr
);
66 if ( (rc2
=write(1,buf
,rc1
)) != rc1
) break;
71 fprintf(stderr
,"\nRead ERROR: %s\n",strerror(errno
));
72 } else if (rc2
== -1) {
73 fprintf(stderr
,"\nWrite ERROR: %s\n",strerror(errno
));
74 } else if (rc2
!= rc1
) {
75 fprintf(stderr
,"\nWrite ERROR: Only %d of %d bytes "
76 "in the last block has been written.\n",rc2
,rc1
);