Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
This function copies an existing file to a new file. A remote API (RAPI) version of this function exists called CeCopyFile (RAPI).
Syntax
BOOL CopyFile( LPCTSTR lpExistingFileName, LPCTSTR lpNewFileName, BOOL bFailIfExists ); |
Parameters
- lpExistingFileName
-
[in] Long pointer to a null-terminated string that specifies the name of an existing file.
- lpNewFileName
-
[in] Long pointer to a null-terminated string that specifies the name of the new file.
- bFailIfExists
-
[in] Boolean that specifies how this operation is to proceed if a file of the same name as that specified by lpNewFileNamealready exists. If this parameter is set to TRUE and the new file already exists, the function fails. If this parameter is set to FALSE and the new file already exists, the function overwrites the existing file and succeeds.
Return Value
Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.
Remarks
File attributes for the existing file are copied to the new file. For example, if an existing file has the FILE_ATTRIBUTE_READONLY file attribute, a copy created through a call to this function also has FILE_ATTRIBUTE_READONLY. For more information, see CreateFile.
To store the maximum number of files on PC card storage devices, limit file names to eight uppercase characters and file extensions to three uppercase characters. In addition, do not allow non-OEM characters in file names. File names that do not conform to these limits require more than one physical directory entry on a PC card.
This function does not operate on directories.
Requirements
Header | winbase.h |
Library | coredll.lib |
Windows Embedded CE | Windows CE 1.0 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |