lab11
lab11
h>
#include <sys/stat.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
char to_upper(char c) {
if (c >= 'a' && c <= 'z') {
return c -= 32;
} else {
return c;
}
}
char buffer[BUFFER_SIZE];
while (1) {
ssize_t bytes_read = read(in_fd, buffer, BUFFER_SIZE);
if (bytes_read == 0) {
break;
} else if (bytes_read < 0) {
printf("READ ERROR: %s\n", strerror(errno));
break;
}
bytes_written += bytes_written_out;
}
close(in_fd);
close(out_fd);
return 0;
}