Ver Mensaje Individual
  #2  
Antiguo 16-03-2004
Avatar de jachguate
jachguate jachguate is offline
Miembro
 
Registrado: may 2003
Ubicación: Guatemala
Posts: 6.254
Reputación: 28
jachguate Va por buen camino
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.

__________________
Juan Antonio Castillo Hernández (jachguate)
Guía de Estilo | Etiqueta CODE | Búsca antes de preguntar | blog de jachguate
Responder Con Cita