With the advent of new file systems such as Ext4, the time between file system syncs will increase to improve performance. At the Tcl script level, it may be advantageous to have an option to fsync a file on close, or fsync after a write.
kbk: suggested fconfigure $chan -synconclose 0
ƎƎ: suggested fconfigure $chan -synconwrite 1 as well.
kbk: responded with [chan sync $chan] as synconwrite would be a bit excessive; explicit-sync makes more sense.
One thing to consider also is the stability of the channel API.
Two options at the C level:
- either grow the channeltype vector (just like for truncate) with a DriverFsyncProc
- or reuse DriverSetOptionsProc with binary option "synconflush"
Note that "synconflush" can emulate both "synconwrite" and "synconclose".
But I'm not advocating one over the other...(it may be felt that growing the channeltype costs nothing).
If you really need things to work properly, use sqlite3 which gets the synching right.