Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Flush why not flush?
Message
From
03/02/2003 23:37:01
 
 
To
03/02/2003 21:58:23
Gerry Schmitz
GHS Automation Inc.
Calgary, Alberta, Canada
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00748117
Message ID:
00748746
Views:
46
>This has got nothing to do with DBFs at the application level.
>
>It's low-level file access with "handles".

It opens a handle to any file, including a DBF, then calls FlushFileBuffers on that file. That writes all unsaved data in that file to disk, not just data that were written via this low-level file handle. So, for example, if you just did a TABLEUPDATE() on Customers.DBF, you'd use Mr. Moody's code to open Customers.dbf with another filehandle and flush the data to disk. You'd also need to use it on Customers.FPT and Customers.CDX. Cumbersome, perhaps, but very effective.

You can also pass FlushFileBuffers a share name as shown in the sample code, and any buffered files on that share, no matter what the application, nor, I believe, who the user, will have their buffered changes written to disk.

FlushFileBuffers is a powerful function, so needs to be used wisely, otherwise you might as well turn off buffered writes on the server.

-Tom

[This post is provided AS-IS with no warranties, and confers no rights.]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform