This program copy anything to anything.Since the input and output can be redirected to any file or device.
We can write a simple program to copy its input to output.we use low level I/O read and write system calls.we have collected function prototypes for the system calls into a file called syscalls.h.so we can include it in this program.but the name syscalls.h is not standard.In UNIX system "unistd.h" is used instead of "syscalls.h".The program code is below:
The parameter BUFSIZ is defined in "stdio.h"; Its value is good size for the local system. if the file size is not a multiple of BUFSIZ, some read will return a smaller number of bytes to be written by write; the next call to read after that will return zero.
We can write a simple program to copy its input to output.we use low level I/O read and write system calls.we have collected function prototypes for the system calls into a file called syscalls.h.so we can include it in this program.but the name syscalls.h is not standard.In UNIX system "unistd.h" is used instead of "syscalls.h".The program code is below:
The parameter BUFSIZ is defined in "stdio.h"; Its value is good size for the local system. if the file size is not a multiple of BUFSIZ, some read will return a smaller number of bytes to be written by write; the next call to read after that will return zero.
No comments:
Post a Comment