Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to flush indexes and memo files to disk
Message
From
12/09/2001 17:50:59
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00555505
Message ID:
00555727
Views:
21
>I verified that when Windows falls down (crash system, electric energy turn off, etc.), Visual FoxPro (version 6, Service pack 5) loses indexes and sometimes memo fields files (*.FPT) remain damaged.
>
>I would like to known if there’s a way (i.e. using some procedure written in C++ for FLL user-library) to force VFP to flush (FLUSH command save only data to disk not indexes, that remain in cache) indexes and memo files to disk when I want.
>
While Flush will write the buffers to disk (all of the dbf, fpt, cdx), it will not force the actual length of files to be written into their directory entries and wherever the OS keeps track of the lengths. It also means that the new blocks allocated to these files may be lost if the files are not regularly closed.

The simple way would be to close and open tables periodically. I've seen this in FPD2.6 - a stuck workstation, which would have to be shut down, would lose data. Opening and closing the same tables from another workstation made sure nothing was lost.

Now with datasessions freely available, you can pretty much grab a list of open tables in any form, create a new datasession, open and close each one in turn, and that's it. If you're willing to test this, you're welcome :).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform