copy_whole.c 347 B

12345678910
  1. #include "common.h"
  2. void copy_data(int fi, int fo, const char* input_path, const char* output_path, size_t size) {
  3. void* data = alloc_buffer(size);
  4. read_fd(input_path, fi, data, size);
  5. printf("read_fd(%zu) input OK\n", size);
  6. write_fd(output_path, fo, data, size);
  7. printf("write_fd(%zu) output OK\n", size);
  8. free(data);
  9. }