Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Seeking Alternative to COPY FILE Command
Message
From
27/11/2000 20:54:01
 
 
To
27/11/2000 10:06:20
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00444304
Message ID:
00445973
Views:
26
Hi Chaim -

I guess there are two questions: using COPY TO - ie. copying an open DBF to another DBF - here I see a problem with losing long field names.

Then there is using DOS or an API call to copy the entire DBF/DBC/CDX/FPT files - ie. a standard backup. Here, my question was : if the tables are open, are the copies going to be any good. My experience has been that DBFs CDXs and FPTs copied while open are not good backups.

I have used SQL code to create backups from running data - locking tables to prevent changes while the backup is going on. I am not quite sure what
>we can know when a backup was made that may not be good (because some user may have been caching data when the backup was made.)< means - it seems that addresses the problem I was talking about.

A questionable backup seems almost worse than no backup - since it give a false sense of security.

No?



>Hi Charles,
> Since you brought up the subject of the difficulty of copying open files, here is my strategy:
> Of course it would be better if no other user were using the file when we try to copy. However, it is not always possible to get the file in EXCLUSIVE mode. Therefore, the best compromise, IMO, is to run the backup at night when few users are likely to be on the system. Then use a DOS command to COPY the file (or something similar to a DOS command, such as the API call Walter suggested or FSO as Alex suggested) to copy the file to another location and back it up from there. There is a chance that the the copy will not be good because someone is using the dbf and some data are cached. My architecture has the ability to know if it has the database in exclusive mode. If it does not have the database in exclusive mode, we must assume that the backup may not have integrity.
> So it's not a perfect system, but it's pretty good, and we can know when a backup was made that may not be good (because some user may have been caching data when the backup was made.)
> I don't favor VFP COPY TO or APPEND FROM style backup bacause it's too slow and it does not prevent the possibility of loss of data integrity.
> Regards, 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