DOS requires an fsync() on the log file each time a record is written. (dm)
Remove unneeded looping logic. (dm)