How do you ensure data is flushed from memory to file?

Last Updated :
Discuss
Comments

How do you ensure data is flushed from memory to file?

fw.flush()

fw.write()

fw.append()

fw.end()

Share your thoughts in the comments