Exception if the file is not opened or if the OS call fails.File.sync
void sync() @trustedForces any data buffered by the OS to be written to disk. Call flush before calling this function to flush the C FILE buffers first.
This function calls
FlushFileBuffers on Windows,
F_FULLFSYNC fcntl on Darwin and
fsync on POSIX for the file handle.