[fpc-pascal] FreePascal Windows - Force files to write to disk

Marco van de Voort marcov at stack.nl
Tue Mar 21 20:48:25 CET 2017


In our previous episode, Henry Vermaak said:
> > Writeln file
> > Writeln file ...
> > Flush file
> 
> Have you tried using the FlushFileBuffers() Windows API?  Something like
> this:
> 
> FlushFileBuffers(TextRec(AFile).Handle);
> 
> Add "windows" to the uses clause, obviously.

He closes the file. That should sync. Sounds to me he is using some dodgy FS
(network?) driver 



More information about the fpc-pascal mailing list