Cita:
Empezado por ms win sdk help
BOOL CopyFile(
LPCTSTR lpExistingFileName, // pointer to name of an existing file
LPCTSTR lpNewFileName, // pointer to filename to copy to
BOOL bFailIfExists // flag for operation if file exists
);
bFailIfExists
Specifies how this operation is to proceed if a file of the same name as that specified by lpNewFileName already exists. If this parameter is TRUE and the new file already exists, the function fails. If this parameter is FALSE and the new file already exists, the function overwrites the existing file and succeeds.
|
según esto, si el último parámetro es false... debiera sobreescribirlo. Eso si, no dice nada de como se comportará si el archivo existe y
es de solo lectura. Por lo pronto, estas seguro que
falso vale
false???
Te sugiero utilizar el CopyFile como condicion en un if, y valerte de GetLastError para ver porque está fallando.
Además, podrias chequear vos mismo que el camino para CopyFile esté libre, valiendote de las rutinas FileExists, GetAttr, SetAttr y DeleteFile.
Hasta luego.