Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Flush why not flush?
Message
De
03/02/2003 23:37:01
 
 
À
03/02/2003 21:58:23
Gerry Schmitz
GHS Automation Inc.
Calgary, Alberta, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00748117
Message ID:
00748746
Vues:
48
>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.]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform