Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Seeking Alternative to COPY FILE Command
Message
 
 
To
23/11/2000 02:57:03
Walter Meester
HoogkarspelNetherlands
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00444304
Message ID:
00448591
Views:
13
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
Previous
Reply
Map
View

Click here to load this message in the networking platform