[SOLVED] File Write/Read synchronization issue

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • [SOLVED] File Write/Read synchronization issue


      I'm facing an issue with emFile write and read synchronization.

      When opening the same file twice (by calling FS_FOpen() twice to get two different file descriptors, this is mandatory in my case) and using the first one to write data and the seconde one to read data.
      The written data is not available for reading.

      I have tried syncing the file descriptors by calling FS_SyncFile(NULL) after the write and also before the read with no success.

      Note that caching and journaling are disabled and the read and write operation are guaranteed to be executed sequentially by the same os task.

      Thank you for your help :)
    • Hello anas,

      You will have to build emFile with FS_MULTI_HANDLE_SAFE set to 1 (FS_MULTI_HANDLE_SAFE) if your application is required to access the same file in read and write mode using different file handles. Would it be possible to give this a try? Thank you.

      Best regards,
      Please read the forum rules before posting.

      Keep in mind, this is *not* a support forum.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support you can contact us via our support system: segger.com/ticket/

      Or you can contact us via e-mail.