Philip Miles <email@example.com> wrote:
I have written an application that logs data to a DOS formatted IBM
Microdrive. I have tried several methods of periodically updating the FAT
on the drive to ensure data is not lost if there is a power fault.
Unfortunately I have not been able to find a reliable method. I have tried
opening / closing the files, calling fsync, fflush etc. I’m not sure if
its a factor or not but my logging system creates two files that are
Does anyone know how to force a FAT update on demand?
It is not possible with the 4.24 product Dosfsys (it maintains an internal
FAT cache without regard to fsync/O_SYNC/etc). The new Fatfsys (available
with 4.25, but can be used by itself on a 4.24 system) does honour all such
attempts to force data physically to disk (as well as providing FAT32 and
non-8.3 / long file name support) … however, if possible you should
consider upgrading fully to 4.25 as Fsys itself also has some bug fixes
for robustness and removable media …