Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Seeking Alternative to COPY FILE Command
Message
From
25/11/2000 23:14:32
 
 
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:
00445456
Views:
30
Ok, I'll show some longstanding ignorance on this one. i was under the impression that DBFs that were open could not be correctly copied (something to do with caching and the end of file marker), hence, Foxpro data could not be backed up while in use.

I take it from your and Chaim's messages that this isn't true, but aren't there problems with stuff that hasn't been written from the cache?

TIA


>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


Charles Hankey

Though a good deal is too strange to be believed, nothing is too strange to have happened.
- Thomas Hardy

Half the harm that is done in this world is due to people who want to feel important. They don't mean to do harm-- but the harm does not interest them. Or they do not see it, or they justify it because they are absorbed in the endless struggle to think well of themselves.

-- T. S. Eliot
Democracy is two wolves and a sheep voting on what to have for lunch.
Liberty is a well-armed sheep contesting the vote.
- Ben Franklin

Pardon him, Theodotus. He is a barbarian, and thinks that the customs of his tribe and island are the laws of nature.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform