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

Jonas Maebe jonas at freepascal.org
Tue Mar 21 20:52:10 CET 2017


On 21/03/17 20:48, Marco van de Voort wrote:
> He closes the file. That should sync.

Not necessarily. On Unix there is also a difference between closing a 
file and calling fsync() on it. And even then there are sometimes 
additional things you may have to do to survive sudden power loss, such 
as first using fcntl(fd,F_FULLFSYNC) on OS X in case you want to OS to 
also instruct the disk controller to flush its internal caches (if 
supported by the disk).


Jonas



More information about the fpc-pascal mailing list