title: File handling in pic32
body: <p>I am using CSV file format for back end purpose, I supposed to update CSV file frequently, so i used to open <code>status.csv</code> file in <code>r+</code> mode.The problem is I couldn't close that CSV, if i do, it goes to exception handling.if i leave it opened, it occupies the heap memory that leads to many problems. </p>
  
  <pre><code>    FSFILE *tp;
      enrowbuf=atoi(httemp);  
      FSchdir("\\"); 
      FSchdir("WWW");
      FSchdir("DBMS"); 
      tp = FSfopen("Status.csv","r+");
      if(tp!=NULL)
          {
          if(enrowbuf==1)
              {
              FSfseek(tp,(43*enrowbuf),SEEK_SET);
              }
          else
              {
              FSfseek(tp,(42*enrowbuf),SEEK_SET);
              FSfwrite(&amp;Relay4,48,1,tp);
              }
          FSfclose(tp);
          }
  </code></pre>