How would you write this code using C stdio library routines instead of the UNIX kernel routines?
Code:
#include <stdio.h>
#include <fcntl.h>
intmain()
{
int inFile, outFile;
char *inFileName = "in_test";
char *outFileName = "out_test";
int len;
char c;
inFile = open(inFileName, O_RDONLY);
outFile = open(outFileName, O_WRONLY);
/* Loop through the input file */
while((len = read(inFile, &c, 1)) > 0)
write(outFile, &c, 1);
/* close files and quit */
close(inFile);
close(outFile);
}
Thanks for your help.