DosCopy copies all files and subdirectories in the source path to the target path. Global file-name characters are not allowed in source or target names. The source and the target can be on different drives.
If an I/O error occurs, DosCopy takes the following actions:
Read-only files in the target path cannot be replaced by a DosCopy request. If such files exist in the target, and option bit flag DCPY_EXISTING is set to 1, any attempt to replace these files with files from the source will result in an error.
When copying is specified for a single file that has option bit flag DCPY_APPEND set to 1, the operation proceeds even if the file already exists and its option bit flag DCPY_EXISTING is set to 0. That is, option bit flag DCPY_EXISTING is significant only when replacing a file, not when appending a file.
If a device name is specified as the target, the source name must be a file, not a directory. When the request is issued, option bit flags DCPY_EXISTING and DCPY_APPEND are ignored.
File-object attributes, such as date of creation, and time of creation, are always copied from the source to the target; however, extended attributes (EAs) are not copied in every case. DosCopy copies EAs from the source to the target when creating a file or directory, or when replacing an existing file on the target; however, it does not copy them when appending an existing file or when copying files to an existing directory on the target. If the file system of the target does not support EAs, DosCopy ends and returns an error.
If the source file object contains a needed EA, and the destination file system does not support EAs, DosCopy fails regardless of the value of option bit flag DCPY_FAILEAS.
DosQuerySysInfo should be called by an application during initialization to determine the maximum path length allowed by the operating system.