45 #include "EST_String.h" 46 #include "EST_error.h" 48 #define BUFFER_SIZE (1024) 82 int main(
int argc,
char *argv[])
90 "Summary; concatenate files in binary mode\n"+
91 "-o <ofile> Ouptut file of binary data\n",
97 out_file = cmd_line.
val(
"-o");
99 EST_error(
"No output file specified");
103 if ((dest=fopen(out_file,
"wb")) == NULL)
104 EST_sys_error(
"Can't create '%s'", (
const char *)out_file);
108 for(item=files.head(); item; item = item->next())
112 if ((src=fopen(files(item),
"rb"))==NULL)
113 EST_sys_error(
"can't read '%s'", (
const char *)files(item));
116 char buf[BUFFER_SIZE];
118 while((n=fread(buf,
sizeof(
char), BUFFER_SIZE, src)) >0)
119 if (fwrite(buf,
sizeof(
char), n, dest) < n)
120 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)