I use this code to copy a file :

int copy_file(char *source, char *dest)
{
  char c;
  int in, out;

  in = open(source, O_RDONLY);
  out = open(dest, O_WRONLY|O_CREAT, S_IRUSR|S_IWUSR);
  while(read(in, &c, 1) == 1)
        write(out, &c, 1);
}

I'd like to add a check for looking if the file is copied (no empty disk and
such). What is the best way to do this ?

-------------------------------------------------------------------------
De Messemaeker Johan
Research & Development
        HEMMIS n.v.
        Koning LeopoldIII-laan 2, 8500 Kortrijk
        Tel.: 32 (0)56/37.26.37
        Fax: 32 (0)56/37.23.24
Current Project : VMM Aalst

Reply via email to