This function copies an existing file to a new file
BOOL CopyFile( LPCSTR lpExistingFileName, LPCSTR lpNewFileName, BOOL bFailIfExists = FALSE )
TRUE for success.
EX1
int CopyFile_ex1() { string strTemp = GetAppPath() + "Origin.ini"; string strNew = GetAppPath() + "junk.ini"; if(!strTemp.IsFile()) { out_str("No Origin.ini found"); return 0 ; } if(strNew.IsFile()) out_str("junk.ini already existed before we copy"); if (!CopyFile(strTemp, strNew)) { out_str("Copy file failed"); return 0; } if(!strNew.IsFile()) out_str("Error: Copy file did not create the junk.ini even though it said it did"); return 1; }
MoveFile
origin.h