Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Seeking Alternative to COPY FILE Command
Message
 
 
À
23/11/2000 02:57:03
Walter Meester
HoogkarspelPays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00444304
Message ID:
00448591
Vues:
19
Walter, thanks for the tip! Not only that, how did you get that code snippet to display so nicely?

>Hi Chaim,
>
>I've run into this very same problem yesterday, the solution was in fact very simple:
>=ADIR(aFiles,"data\*.*")
>
>DECLARE INTEGER CopyFile IN KERNEL32.DLL ;
>   STRING @SourceFileName, ;
>   STRING @DestFileName, ;
>   INTEGER bFailIfExists
>
>nSucces=0
>FOR nT = 1 TO ALEN(aFiles,1)
>	nSucces=CopyFile(SYS(5)+SYS(2003)+"\data\"+aFiles[nT,1],;
>                SYS(5)+SYS(2003)+"\dataexport\"+aFiles[nT,1],0)
>
>        .... show progress or something
>
>	IF nSucces = 0
>                ... Handle error
>		exit &&
>	ENDIF
>ENDFOR
GoodLuck,
>
>Walter,
>
>>I need to copy DBFs / CDXs / FPTs from one directory to another (for backup purposes). The VFP command COPY FILE fails if the table is open. I am currently shelling to DOS and using the COPY command (in DOS) which works even when the table is open, but I would rather not shell out to DOS. Are there any alternatives? I also don't want to resort to ActiveX controls.
>> Thanks, Chaim
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform