title: Read from a certain part of a file PIC32MX
body: <p>I am using PIC32MX in a design made by myself and everything is working perfectly.</p>
  
  <p>Now I am trying to implement a feature which is basically read from a file sequentially until I found a certain frame of characters, so I am doing:</p>
  
  <pre><code>    while( (readedBytes = FSfread((void *)&amp;c,sizeof(char),1,ephpubData-&gt;filetouart) != 0) &amp;&amp; G_RUNNING &amp;&amp; ephpubData-&gt;readedBytes &lt; 2520){
      privData-&gt;txBuffer[privData-&gt;txBufferPos++] = c;
      ephpubData-&gt;readedBytes = ephpubData-&gt;readedBytes + readedBytes;
      if (privData-&gt;txBufferPos == TX_BUFFER_SIZE){
          if (verifyDate (task) == 1){
          *gpsState = GPS_STATE_VERIFY;
          ephpubData-&gt;count++;
          break;
          }
          FSfseek(ephpubData-&gt;filetouart , ephpubData-&gt;readedBytes , SEEK_SET);
          privData-&gt;txBufferPos = 0;
     }
  }
  </code></pre>
  
  <p>For the first time when it finds the frame (using the verifyDate function) everything is ok and it goes to break sentence.
  When it comes to read the second time in the while loop (after close/reopen the file and doing other things in the code) it goes to the first position again.
  So I want to save the the latest position found until the break sentence. I already tried to use the seek function for every while iteration</p>
  
  <pre><code>    while( (readedBytes = FSfread((void *)&amp;c,sizeof(char),1,ephpubData-&gt;filetouart-&gt;seek) != 0) &amp;&amp; G_RUNNING &amp;&amp; ephpubData-&gt;readedBytes &lt; 2520)
  </code></pre>
  
  <p>but it gave me an error.</p>