#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>

#ifdef __unix__
      #include <unistd.h>
      #include <sys/stat.h>
      #include <sys/types.h>
#elif __MSDOS__
      #include <io.h>
      #include <sys\stat.h>
#endif
#define MAXBYTES 1024

main(int arg, char **argv)
{
 int in,out,count;

 char buffer[MAXBYTES];

 if((in=open(*++argv,O_RDONLY)) == -1)
   printf("Fehler open %s\n",argv);
 if((out=open(*++argv,O_WRONLY|O_TRUNC|O_CREAT,0644))== -1)
   printf("Fehler open %s\n",argv);
 while(count = read(in,buffer,MAXBYTES))
   write(out,buffer,count);

 close(in);
 close(out);
}
