Copiar ficheros.

Copiar ficheros.

Postby FiveWiDi » Tue Jun 03, 2008 3:26 pm

Hola a todos,

para copiar ficheros engtre unidades utilizo COPY FILE .. TO .., y parece que todo va bien.

Pero como lo hago para que al copiar el fichero me conserve la fecha y hora original del fichero origen?

Saludos
Carlos G.
FiveWiDi
 
Posts: 1200
Joined: Mon Oct 10, 2005 2:38 pm

Postby karinha » Tue Jun 03, 2008 7:47 pm

Code: Select all  Expand view  RUN
    COPYFILE( "Z:\PIZZAS\CLIENTES.DBF", "C:\PIZZAS\CLIENTES.DBF", .F. )
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7860
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Postby FiveWiDi » Wed Jun 04, 2008 8:17 am

karinha wrote:
Code: Select all  Expand view  RUN
    COPYFILE( "Z:\PIZZAS\CLIENTES.DBF", "C:\PIZZAS\CLIENTES.DBF", .F. )


Gracias,

para que sirve el 3er. parámetro .F.?

Saludos
Carlos G.
FiveWiDi
 
Posts: 1200
Joined: Mon Oct 10, 2005 2:38 pm

Postby Antonio Linares » Wed Jun 04, 2008 9:52 am

Carlos,

El tercer parámetro es para que lo sobreescriba en caso de existir:

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.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42160
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby FiveWiDi » Wed Jun 04, 2008 1:06 pm

Antonio Linares wrote:Carlos,

El tercer parámetro es para que lo sobreescriba en caso de existir:

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.


Gracias a ambos,

Saludos
Carlos G.
FiveWiDi
 
Posts: 1200
Joined: Mon Oct 10, 2005 2:38 pm


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 28 guests

cron