FCOPY - C function to perform file copies.
Version 2.0

     This archive contains the following files:

          fcopy.c
          fcopy.h
          copyfile.asm
          copytest.c
          copytest.exe
          fcopy11.zip (the earlier version of fcopy)
          readme (this file)

     _fcopy is a C function that copies one file to another, much like
     the DOS COPY command.  It operates on single files only (i.e., does
     not accept wildcards).  To copy multiple files, _fcopy must be used
     in a loop with findfirst and findnext functions (Turbo C++ library
     -- other compilers have similar names).

     _fcopy also does not check to see if the specified files are the
     same, so it is up to the calling function to verify that the two
     file specs do not, in fact, refer to the same file.

     Version 2.0 of _fcopy calls the function _copyfile (written in
     assembler) to perform the actual reads and writes.  Source is
     contained in the file COPYFILE.ASM.

     Version 1.1 of _fcopy used separate functions _farread and
     _farwrite to perform the reads and writes to a far buffer.  Since
     these two can be used as general purpose functions, the version 1.1
     archive is also provided in the file FCOPY11.ZIP.

     The new version 2.0 (using _copyfile) has a slight size and speed
     advantage over the earlier version, in that the far pointer to the
     file buffer needs to be loaded only once for the entire copy
     operation.  The copy loop is completely contained within the single
     assembler module.

     Usage for the function in a C program is as follows:

          #include "fcopy.h"
          int _fcopy (char *sourcename, char *destname)

     The function returns 0 on success, and -1 if an error occurred.  On
     failure, the global variables errno and _doserrno are set to one of
     the following:

          EINVFNC     Invalid function number  (1)
          ENOFILE     File not found  (2)
          ENOPATH     Path not found  (3)
          EMFILE      Too many open files  (4)
          EACCESS     Permission denied  (5)
          EBADF       Bad file number  (6)
          ECONTR      Memory blocks destroyed  (7)
          ENOMEM      Not enough core  (8)
          EINVMEM     Invalid memory block address  (9)
          EINVACC     Invalid access code  (12)
               -1     Target disk full  (-1)

     See the source code for more information.

     A short demo program (COPYTEST.EXE) is included.  It prompts the
     user for source and target filenames and then performs the copy. If
     an error occurred during the copy operation, an error message is
     displayed.  (This simple program does NOT test the source and
     target filenames to detect whether they actually refer to the same
     file.)

     To compile the demo program using Turbo C++, use the following
     command line (for the default memory model):

         tcc copytest fcopy copyfile.asm

     Other memory models are supported; compile by defining the macro
     _model=[model], where model is small, medium, compact, large, or
     huge.  Example:

         tcc -ml -Td_model=large copytest fcopy copyfile.asm


     Ray Waters
     CompuServe ID 72261,33
     March 16, 1992
