Hello! I’m writing a Qt/c++ program that should write and read data on a file, while another process does the same. What file format should I use to prevent conflicts?

  • tatterdemalion
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    1 year ago

    If two processes are writing to the same file at the same time it will be corrupted.

    That’s not true. You just need to make sure the processes are writing to disjoint regions of the file. I wouldn’t recommend it unless you have a good reason though.

    • stifle867
      link
      fedilink
      arrow-up
      4
      ·
      1 year ago

      It still can corrupt due to certain factors like writes not immediately being propagated to disk. In theory it’s possible just harder than you’d think.