 |
ReplaceFile ..msdn Add comment W32 Constants Translate this page |
 |
 |
|
Replaces one file with another file, with the option of creating a backup copy of the original file. |
 |
 |
| Code examples: |
 |
|
|
 |
 |
| Declaration: |
 |
 |
BOOL WINAPI ReplaceFile(
__in LPCTSTR lpReplacedFileName,
__in LPCTSTR lpReplacementFileName,
__in_opt LPCTSTR lpBackupFileName,
__in DWORD dwReplaceFlags,
__reserved LPVOID lpExclude,
__reserved LPVOID lpReserved
);
|
 |
 |
 |
| FoxPro declaration: |
 |
 |
DECLARE INTEGER ReplaceFileA IN kernel32;
STRING lpReplacedFileName,;
STRING lpReplacementFileName,;
STRING lpBackupFileName,;
LONG dwReplaceFlags,;
INTEGER lpExclude,;
INTEGER lpReserved
|
 |
 |
 |
| Parameters: |
 |
lpReplacedFileName [in]
The name of the file to be replaced.
lpReplacementFileName [in]
The name of the file that will replace the lpReplacedFileName file.
lpBackupFileName [in, optional]
The name of the file that will serve as a backup copy of the lpReplacedFileName file. If this parameter is NULL, no backup file is created.
dwReplaceFlags [in]
The replacement options.
lpExclude
Reserved for future use.
lpReserved
Reserved for future use. |
 |
 |
| Return value: |
 |
| If the function succeeds, the return value is nonzero. |
 |
 |
| Usage: |
 |
#DEFINE REPLACEFILE_WRITE_THROUGH 1
LOCAL cToBeReplaced, cReplaceWith, cBak
cToBeReplaced = "c:\temp\test123.txt"
cReplaceWith = "c:\temp\test123456.txt"
cBak = "c:\temp\test123.bak"
IF ReplaceFileA(cToBeReplaced, cReplaceWith, cBak,;
REPLACEFILE_WRITE_THROUGH, 0, 0) = 0
? GetLastError()
ENDIF
|
 |
 |
| My comment: |
 |
| In VFP use the ASCII version for this function, unless you specifically convert the first three input parameters (file names) into Unicode strings. |
 |
 |
| Word Index links for the ReplaceFile : |
 |
|
|
 |
 |
| Translate this page: |
 |
|
 |
 |
| • |
 |
| Created: | 2008-12-08 13:19:53 | | Modified: | 2008-12-08 13:24:38 | Visited in last 7 days: 14 |