45 #include "EST_String.h"
46 #include "EST_error.h"
48 #define BUFFER_SIZE (1024)
50 int main(
int argc,
char *argv[])
58 "Summary; concatenate files in binary mode\n"+
59 "-o <ofile> Ouptut file of binary data\n",
65 out_file = cmd_line.
val(
"-o");
67 EST_error(
"No output file specified");
71 if ((dest=fopen(out_file,
"wb")) == NULL)
72 EST_sys_error(
"Can't create '%s'", (
const char *)out_file);
76 for(item=files.head(); item; item = item->next())
80 if ((src=fopen(files(item),
"rb"))==NULL)
81 EST_sys_error(
"can't read '%s'", (
const char *)files(item));
84 char buf[BUFFER_SIZE];
86 while((n=fread(buf,
sizeof(
char), BUFFER_SIZE, src)) >0)
87 if (fwrite(buf,
sizeof(
char), n, dest) < n)
88 EST_sys_error(
"write error");
const int present(const K &rkey) const
Returns true if key is present.
const V & val(const K &rkey, bool m=0) const
return value according to key (const)