swaroop: try fflush() as well as fsync().