In an application that writes user data to a text file, what precaution should be taken to avoid data corruption or loss?

  • Delay disk writes to optimize performance.
  • Ensure the application flushes the buffer after each write.
  • Overwrite existing data without checking for errors.
  • Use a non-atomic write operation.
To avoid data corruption or loss, it's crucial to flush the buffer after each write operation to ensure data is written to the file immediately.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *