src/stdlib/fileops.c
/*======================================================
 * filecopy -- Copy data from one file to another
 * Copy from source file (already opened) to destination
 * file (already opened).
 *====================================================*/
- Copy data from one file to another
Copy from source file (already opened) to destination
file (already opened).
- Copy data from one file to another Copy from source file ( already opened ) to destination file ( already opened ) .
void
filecopy (FILE* fpsrc, INT len, FILE* fpdest)
{
        char buffer[LLSTDLIB_BUFLEN];
        while (len) {
                INT blklen = (len > LLSTDLIB_BUFLEN) ? LLSTDLIB_BUFLEN : len;
                ASSERT(fread(buffer, blklen, 1, fpsrc) == 1);
                ASSERT(fwrite(buffer, blklen, 1, fpdest) == 1);
                len -= blklen;
        }
}
void filecopy ( FILE * fpsrc , INT len , FILE * fpdest ) { char buffer [ LLSTDLIB_BUFLEN ] ; while ( len ) { INT blklen = ( len > LLSTDLIB_BUFLEN ) ? LLSTDLIB_BUFLEN : len ; ASSERT ( fread ( buffer , blklen , 1 , fpsrc ) == 1 ) ; ASSERT ( fwrite ( buffer , blklen , 1 , fpdest ) == 1 ) ; len -= blklen ; } }
filecopy -- Copy data from one file to another
 Copy from source file (already opened) to destination
 file (already opened).
filecopy -- Copy data from one file to another Copy from source file ( already opened ) to destination file ( already opened ) .
/* copy LLSTDLIB_BUFLEN at a time til the last little bit */ /* assumes full buffer copy each time, so only appropriate
                for binary file copies (because of \r\n translation on Win32) */