Copies a file, or a portion of a file, to another file.
#include <fsio.h> int fscopy ( int fildes1, int fildes2, off64_t offset1, off64_t offset2, size_t length, size_t *nbytes );
(IN) Specifies the source file from which to copy data.
(IN) Specifies the destination file into which data is copied.
(IN) Specifies the offset (in bytes) in the source file where copy should begin.
(IN) Specifies the offset (in bytes) in the destination file where the data should be copied.
(IN) Specifies the number of bytes to copy.
(OUT) Points to the number of bytes actually copied.
If successful, returns 0. Otherwise, returns -1 and sets errno.
A file handle can be obtained by calling the open, sopen, or creat function.
To copy from the beginning of the source file to a new file, set the offset1 and offset2 parameters to 0x00.To copy the entire source file, specify a value in the length parameter that matches or exceeds the file size.